diff --git a/lib/brakeman/report/report_tabs.rb b/lib/brakeman/report/report_tabs.rb index 9e86793a7a3ac679db3924db507c254f71132d33..2347f5acae1c540017fcbd3881c41dc4e3f62c7a 100644 --- a/lib/brakeman/report/report_tabs.rb +++ b/lib/brakeman/report/report_tabs.rb @@ -2,10 +2,10 @@ #https://github.com/presidentbeef/brakeman-jenkins-plugin class Brakeman::Report::Tabs < Brakeman::Report::Base def generate_report - [[:warnings, "General"], [:controller_warnings, "Controller"], + [[:generic_warnings, "General"], [:controller_warnings, "Controller"], [:model_warnings, "Model"], [:template_warnings, "Template"]].map do |meth, category| - checks.send(meth).map do |w| + self.send(meth).map do |w| line = w.line || 0 w.warning_type.gsub!(/[^\w\s]/, ' ') "#{warning_file(w, :absolute)}\t#{line}\t#{w.warning_type}\t#{category}\t#{w.format_message}\t#{TEXT_CONFIDENCE[w.confidence]}" diff --git a/test/tests/tabs_output.rb b/test/tests/tabs_output.rb new file mode 100644 index 0000000000000000000000000000000000000000..dfbef704ab9960275de65f5e1a2e15c911f72faa --- /dev/null +++ b/test/tests/tabs_output.rb @@ -0,0 +1,11 @@ +class TestTabsOutput < Test::Unit::TestCase + Report = Brakeman.run(:app_path => "#{TEST_PATH}/apps/rails2", :quiet => true).report.to_tabs + + def test_reported_warnings + if Brakeman::Scanner::RUBY_1_9 + assert_equal Report.lines.to_a.count, 96 + else + assert_equal Report.lines.to_a.count, 97 + end + end +end