inspec/test/unit/reporters/yaml_test.rb
Noel Georgi 317a6d1953 Adding YAML reporter (#3081)
* Adding YAML reporter
* Updating yaml o/p
* Removing comment
* Adding UT for YAML reporter, adding missing reporters
* This PR takes care of the following:
 - Fixes the YAML reporter UT
 - Adds the report method to YAML reporter to support code example as in #3085
 - Disables the cyclomatic complexity Metric for reporter

Signed-off-by: Noel Georgi <18496730+frezbo@users.noreply.github.com>
2018-05-31 13:42:09 -04:00

19 lines
485 B
Ruby

# encoding: utf-8
require 'helper'
describe Inspec::Reporters::Yaml do
let(:path) { File.expand_path(File.dirname(__FILE__)) }
let(:report) do
data = YAML.load_file(path + '/../mock/reporters/run_data.yml')
Inspec::Reporters::Yaml.new({ run_data: data })
end
describe '#render' do
it 'confirm render output' do
output = File.read(path + '/../mock/reporters/yaml_output')
report.render
report.rendered_output.must_equal output
end
end
end