提交 bd1d9250 编写于 作者: J Justin Collins

Fix line numbers in tests (to better ones!)

上级 89bcd139
...@@ -32,7 +32,7 @@ class Rails2Tests < Test::Unit::TestCase ...@@ -32,7 +32,7 @@ class Rails2Tests < Test::Unit::TestCase
def test_eval def test_eval
assert_warning :warning_type => "Dangerous Eval", assert_warning :warning_type => "Dangerous Eval",
:line => 41, :line => 40,
:message => /^User input in eval/, :message => /^User input in eval/,
:code => /eval\(params\[:dangerous_input\]\)/, :code => /eval\(params\[:dangerous_input\]\)/,
:file => /home_controller.rb/ :file => /home_controller.rb/
...@@ -57,7 +57,7 @@ class Rails2Tests < Test::Unit::TestCase ...@@ -57,7 +57,7 @@ class Rails2Tests < Test::Unit::TestCase
def test_command_injection_direct def test_command_injection_direct
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "Command Injection", :warning_type => "Command Injection",
:line => 37, :line => 36,
:message => /^Possible command injection/, :message => /^Possible command injection/,
:confidence => 0, :confidence => 0,
:file => /home_controller\.rb/, :file => /home_controller\.rb/,
...@@ -103,8 +103,8 @@ class Rails2Tests < Test::Unit::TestCase ...@@ -103,8 +103,8 @@ class Rails2Tests < Test::Unit::TestCase
def test_dynamic_render_path def test_dynamic_render_path
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "Dynamic Render Path", :warning_type => "Dynamic Render Path",
:line => 60, :line => 59,
:message => /^Render path contains parameter value near line 60: render/, :message => /^Render path contains parameter value near line 59: render/,
:confidence => 1, :confidence => 1,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
end end
...@@ -112,8 +112,8 @@ class Rails2Tests < Test::Unit::TestCase ...@@ -112,8 +112,8 @@ class Rails2Tests < Test::Unit::TestCase
def test_dynamic_render_path_high_confidence def test_dynamic_render_path_high_confidence
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "Dynamic Render Path", :warning_type => "Dynamic Render Path",
:line => 78, :line => 77,
:message => /^Render path contains parameter value near line 78: render/, :message => /^Render path contains parameter value near line 77: render/,
:confidence => 0, :confidence => 0,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
end end
...@@ -121,7 +121,7 @@ class Rails2Tests < Test::Unit::TestCase ...@@ -121,7 +121,7 @@ class Rails2Tests < Test::Unit::TestCase
def test_file_access def test_file_access
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "File Access", :warning_type => "File Access",
:line => 22, :line => 21,
:message => /^Parameter value used in file name/, :message => /^Parameter value used in file name/,
:confidence => 0, :confidence => 0,
:file => /other_controller\.rb/ :file => /other_controller\.rb/
...@@ -130,7 +130,7 @@ class Rails2Tests < Test::Unit::TestCase ...@@ -130,7 +130,7 @@ class Rails2Tests < Test::Unit::TestCase
def test_file_access_with_load def test_file_access_with_load
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "File Access", :warning_type => "File Access",
:line => 64, :line => 63,
:message => /^Parameter value used in file name/, :message => /^Parameter value used in file name/,
:confidence => 0, :confidence => 0,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
...@@ -139,7 +139,7 @@ class Rails2Tests < Test::Unit::TestCase ...@@ -139,7 +139,7 @@ class Rails2Tests < Test::Unit::TestCase
def test_file_access_load_false def test_file_access_load_false
warnings = find :type => :warning, warnings = find :type => :warning,
:warning_type => "File Access", :warning_type => "File Access",
:line => 65, :line => 64,
:message => /^Parameter value used in file name/, :message => /^Parameter value used in file name/,
:confidence => 0, :confidence => 0,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
......
...@@ -26,8 +26,8 @@ class Rails3Tests < Test::Unit::TestCase ...@@ -26,8 +26,8 @@ class Rails3Tests < Test::Unit::TestCase
def test_eval_params def test_eval_params
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "Dangerous Eval", :warning_type => "Dangerous Eval",
:line => 41, :line => 40,
:message => /^User input in eval near line 41: eval\(pa/, :message => /^User input in eval near line 40: eval\(pa/,
:confidence => 0, :confidence => 0,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
end end
...@@ -53,8 +53,8 @@ class Rails3Tests < Test::Unit::TestCase ...@@ -53,8 +53,8 @@ class Rails3Tests < Test::Unit::TestCase
def test_command_injection_system_params def test_command_injection_system_params
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "Command Injection", :warning_type => "Command Injection",
:line => 37, :line => 36,
:message => /^Possible command injection near line 37:/, :message => /^Possible command injection near line 36:/,
:confidence => 0, :confidence => 0,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
end end
...@@ -71,7 +71,7 @@ class Rails3Tests < Test::Unit::TestCase ...@@ -71,7 +71,7 @@ class Rails3Tests < Test::Unit::TestCase
def test_file_access_load def test_file_access_load
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "File Access", :warning_type => "File Access",
:line => 68, :line => 67,
:message => /^Parameter value used in file name near l/, :message => /^Parameter value used in file name near l/,
:confidence => 0, :confidence => 0,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
...@@ -143,8 +143,8 @@ class Rails3Tests < Test::Unit::TestCase ...@@ -143,8 +143,8 @@ class Rails3Tests < Test::Unit::TestCase
def test_redirect_url_for_not_only_path def test_redirect_url_for_not_only_path
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "Redirect", :warning_type => "Redirect",
:line => 84, :line => 83,
:message => /^Possible unprotected redirect near line 84: redirect_to\(url_for/, :message => /^Possible unprotected redirect near line 83: redirect_to\(url_for/,
:confidence => 0, :confidence => 0,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
end end
...@@ -152,8 +152,8 @@ class Rails3Tests < Test::Unit::TestCase ...@@ -152,8 +152,8 @@ class Rails3Tests < Test::Unit::TestCase
def test_render_path def test_render_path
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "Dynamic Render Path", :warning_type => "Dynamic Render Path",
:line => 64, :line => 63,
:message => /^Render path contains parameter value near line 64: render/, :message => /^Render path contains parameter value near line 63: render/,
:confidence => 1, :confidence => 1,
:file => /home_controller\.rb/ :file => /home_controller\.rb/
end end
...@@ -161,7 +161,7 @@ class Rails3Tests < Test::Unit::TestCase ...@@ -161,7 +161,7 @@ class Rails3Tests < Test::Unit::TestCase
def test_file_access_send_file def test_file_access_send_file
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "File Access", :warning_type => "File Access",
:line => 22, :line => 21,
:message => /^Parameter value used in file name near l/, :message => /^Parameter value used in file name near l/,
:confidence => 0, :confidence => 0,
:file => /other_controller\.rb/ :file => /other_controller\.rb/
......
...@@ -121,7 +121,7 @@ class RailsWithXssPluginTests < Test::Unit::TestCase ...@@ -121,7 +121,7 @@ class RailsWithXssPluginTests < Test::Unit::TestCase
def test_redirect_11 def test_redirect_11
assert_warning :type => :warning, assert_warning :type => :warning,
:warning_type => "Redirect", :warning_type => "Redirect",
:line => 96, :line => 95,
:message => /^Possible\ unprotected\ redirect/, :message => /^Possible\ unprotected\ redirect/,
:confidence => 0, :confidence => 0,
:file => /users_controller\.rb/ :file => /users_controller\.rb/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册