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

Add basic JSON compare test

上级 b4ea8490
class JSONCompareTests < Test::Unit::TestCase
include BrakemanTester::DiffHelper
def setup
@path = File.expand_path "#{TEST_PATH}/apps/rails3.2"
@json_path = File.join @path, "report.json"
File.delete @json_path if File.exist? @json_path
Brakeman.run :app_path => @path, :output_files => [@json_path]
@report = JSON.parse File.read(@json_path)
end
def update_json
File.open @json_path, "w" do |f|
f.puts @report.to_json
end
end
def diff
@diff = Brakeman.compare :app_path => @path, :previous_results_json => @json_path
end
def test_sanity
diff
assert_fixed 0
assert_new 0
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册