inspec/test/unit/reporters/json_min_test.rb
Clinton Wolfe 99ec27b337 Fix json-min reporter unit test
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-02 21:35:16 -04:00

26 lines
920 B
Ruby

require "helper"
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"
describe InspecPlugins::JsonMinReporter::Reporter do
let(:reporter) do
data = JSON.parse(File.read("test/fixtures/reporters/run_data.json"), symbolize_names: true)
InspecPlugins::JsonMinReporter::Reporter.new({ run_data: data })
end
describe "#render" do
it "confirm render output" do
output = File.read("test/fixtures/reporters/json_min_output")
reporter.render
_(reporter.rendered_output).must_equal output
end
end
describe "#report" do
it "confirm report output" do
output = File.read("test/fixtures/reporters/json_min_output")
output = JSON.parse(output, symbolize_names: true)
_(reporter.report).must_equal output
end
end
end