mirror of
https://github.com/inspec/inspec
synced 2024-11-22 12:43:07 +00:00
UNIT_TESTS: update yaml reporter test for Ruby 3+
Signed-off-by: Marijus Ravickas <marijus.ravickas@gmail.com>
This commit is contained in:
parent
79f11561fb
commit
1d672feca4
3 changed files with 7 additions and 3 deletions
|
@ -139,6 +139,10 @@ def expect_deprecation(group, &block)
|
||||||
handle_deprecations(group => :expect_something, all_others: :tolerate, &block)
|
handle_deprecations(group => :expect_something, all_others: :tolerate, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def darwin?
|
||||||
|
!!(RbConfig::CONFIG["host_os"] =~ /darwin/)
|
||||||
|
end
|
||||||
|
|
||||||
class Minitest::Test
|
class Minitest::Test
|
||||||
# TODO: push up to minitest
|
# TODO: push up to minitest
|
||||||
def skip_until(y, m, d, msg)
|
def skip_until(y, m, d, msg)
|
||||||
|
|
|
@ -11,10 +11,10 @@ describe Inspec::Reporters::Yaml do
|
||||||
|
|
||||||
describe "#render" do
|
describe "#render" do
|
||||||
it "confirm render output" do
|
it "confirm render output" do
|
||||||
if windows? && RUBY3_PLUS
|
if ( windows? || darwin? ) && RUBY3_PLUS
|
||||||
# Under Windows on Ruby 3+, empty scalar values are generated without a trailing space
|
# On Ruby 3+, empty scalar values are generated without a trailing space
|
||||||
# this affects the title: and desc: fields
|
# this affects the title: and desc: fields
|
||||||
output = File.read("test/fixtures/reporters/yaml_output_windows_ruby3plus")
|
output = File.read("test/fixtures/reporters/yaml_output_ruby3plus")
|
||||||
else
|
else
|
||||||
output = File.read("test/fixtures/reporters/yaml_output")
|
output = File.read("test/fixtures/reporters/yaml_output")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue