mirror of
https://github.com/inspec/inspec
synced 2024-12-24 12:03:23 +00:00
0dc0e3b457
Signed-off-by: Jared Quick <jquick@chef.io>
31 lines
962 B
Ruby
31 lines
962 B
Ruby
# encoding: utf-8
|
|
# copyright: 2017, Chef Software Inc.
|
|
|
|
require 'helper'
|
|
require 'inspec/objects'
|
|
|
|
describe 'rspec_json_formatter' do
|
|
describe 'InspecRspecCli::Control' do
|
|
# have to require here else it messes with minitest
|
|
require 'inspec/rspec_json_formatter'
|
|
|
|
let(:control) do
|
|
control = { results: [], title: 'test' }
|
|
InspecRspecCli::Control.new(control, nil)
|
|
end
|
|
|
|
it 'summary must count unique fails/skips' do
|
|
control.expects(:summary_calculation_needed?).returns(false)
|
|
control.stubs(:fails).returns([1, 1])
|
|
control.stubs(:skips).returns([1, 1])
|
|
control.summary.must_equal 'test (2 failed 2 skipped)'
|
|
end
|
|
|
|
it 'summary must count different fails/skips' do
|
|
control.expects(:summary_calculation_needed?).returns(false)
|
|
control.stubs(:fails).returns([1, 2])
|
|
control.stubs(:skips).returns([1, 2])
|
|
control.summary.must_equal 'test (2 failed 2 skipped)'
|
|
end
|
|
end
|
|
end
|