2019-06-11 22:24:35 +00:00
|
|
|
require "helper"
|
|
|
|
require "inspec/reporters"
|
2018-02-08 09:06:58 +00:00
|
|
|
|
|
|
|
describe Inspec::Reporters::JsonMin do
|
|
|
|
let(:path) { File.expand_path(File.dirname(__FILE__)) }
|
2018-02-09 14:14:40 +00:00
|
|
|
let(:report) do
|
2019-06-11 22:24:35 +00:00
|
|
|
data = JSON.parse(File.read(path + "/../mock/reporters/run_data.json"), symbolize_names: true)
|
2018-02-08 09:06:58 +00:00
|
|
|
Inspec::Reporters::JsonMin.new({ run_data: data })
|
|
|
|
end
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
describe "#render" do
|
|
|
|
it "confirm render output" do
|
|
|
|
output = File.read(path + "/../mock/reporters/json_min_output")
|
2018-02-08 09:06:58 +00:00
|
|
|
report.render
|
2018-02-09 14:14:40 +00:00
|
|
|
report.rendered_output.must_equal output
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
describe "#report" do
|
|
|
|
it "confirm report output" do
|
|
|
|
output = File.read(path + "/../mock/reporters/json_min_output")
|
2018-02-09 14:14:40 +00:00
|
|
|
output = JSON.parse(output, symbolize_names: true)
|
|
|
|
report.report.must_equal output
|
2018-02-08 09:06:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|