Fix json automate render and make the unit tests work. (#3408)

Signed-off-by: Jared Quick <jquick@chef.io>
This commit is contained in:
Jared Quick 2018-09-18 14:20:48 -04:00 committed by GitHub
parent 3e77734645
commit 44c4146a92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -10,7 +10,7 @@ module Inspec::Reporters
end end
def render def render
output(report_merged.to_json, false) output(report.to_json, false)
end end
def report def report

View file

@ -8,7 +8,7 @@ describe Inspec::Reporters::JsonAutomate do
data = JSON.parse(File.read(path + '/../mock/reporters/run_data_wrapper.json'), symbolize_names: true) data = JSON.parse(File.read(path + '/../mock/reporters/run_data_wrapper.json'), symbolize_names: true)
Inspec::Reporters::JsonAutomate.new({ run_data: data }) Inspec::Reporters::JsonAutomate.new({ run_data: data })
end end
let(:profiles) { report.report[:profiles] } let(:profiles) { report.send(:profiles) }
describe '#render' do describe '#render' do
it 'confirms render output' do it 'confirms render output' do
@ -22,7 +22,7 @@ describe Inspec::Reporters::JsonAutomate do
it 'outputs the correct report_merged' do it 'outputs the correct report_merged' do
output = File.read(path + '/../mock/reporters/json_merged_output') output = File.read(path + '/../mock/reporters/json_merged_output')
output = JSON.parse(output, symbolize_names: true) output = JSON.parse(output, symbolize_names: true)
report.report_merged.must_equal output report.report.must_equal output
end end
end end