提交 01aca5ee 编写于 作者: J Justin Collins

Change Report#to_test to Report#to_hash

上级 905a36fb
......@@ -4,8 +4,9 @@ require 'brakeman/report/report_base'
#Tracker#run_checks. Be sure to +run_checks+ before generating
#a report.
class Brakeman::Report
attr_reader :tracker
VALID_FORMATS = [:to_html, :to_pdf, :to_csv, :to_json, :to_tabs, :to_test, :to_s]
VALID_FORMATS = [:to_html, :to_pdf, :to_csv, :to_json, :to_tabs, :to_hash, :to_s]
def initialize(app_tree, tracker)
@app_tree = app_tree
......@@ -25,9 +26,9 @@ class Brakeman::Report
when :to_tabs
require_report 'tabs'
Brakeman::Report::Tabs
when :to_test
require_report 'test'
Brakeman::Report::Test
when :to_hash
require_report 'hash'
Brakeman::Report::Hash
when :to_s
return self.to_s
when :to_pdf
......
# Generates a hash table for use in Brakeman tests
class Brakeman::Report::Test < Brakeman::Report::Base
class Brakeman::Report::Hash < Brakeman::Report::Base
def generate_report
report = { :errors => tracker.errors,
:controllers => tracker.controllers,
......
......@@ -37,7 +37,7 @@ module BrakemanTester
announce "Processing #{name} application..."
Brakeman.run(opts).report.to_test
Brakeman.run(opts).report.to_hash
end
#Make an announcement
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册