2019-06-11 22:24:35 +00:00
|
|
|
require "helper"
|
2020-06-03 01:35:16 +00:00
|
|
|
require_relative "../../../lib/plugins/inspec-reporter-json-min/lib/inspec-reporter-json-min"
|
|
|
|
require_relative "../../../lib/plugins/inspec-reporter-json-min/lib/inspec-reporter-json-min/reporter"
|
2018-02-08 09:06:58 +00:00
|
|
|
|
2020-06-03 01:35:16 +00:00
|
|
|
describe InspecPlugins::JsonMinReporter::Reporter do
|
|
|
|
let(:reporter) do
|
2019-11-09 03:08:20 +00:00
|
|
|
data = JSON.parse(File.read("test/fixtures/reporters/run_data.json"), symbolize_names: true)
|
2020-06-03 01:35:16 +00:00
|
|
|
InspecPlugins::JsonMinReporter::Reporter.new({ run_data: data })
|
2018-02-08 09:06:58 +00:00
|
|
|
end
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
describe "#render" do
|
|
|
|
it "confirm render output" do
|
2019-11-09 03:08:20 +00:00
|
|
|
output = File.read("test/fixtures/reporters/json_min_output")
|
2020-06-03 01:35:16 +00:00
|
|
|
reporter.render
|
|
|
|
_(reporter.rendered_output).must_equal output
|
2018-02-09 14:14:40 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
describe "#report" do
|
|
|
|
it "confirm report output" do
|
2019-11-09 03:08:20 +00:00
|
|
|
output = File.read("test/fixtures/reporters/json_min_output")
|
2018-02-09 14:14:40 +00:00
|
|
|
output = JSON.parse(output, symbolize_names: true)
|
2020-06-03 01:35:16 +00:00
|
|
|
_(reporter.report).must_equal output
|
2018-02-08 09:06:58 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|