Merge pull request #656 from chef/dr/cmp-info

bugfix: print cmp expectations
This commit is contained in:
Christoph Hartmann 2016-04-17 18:57:34 -04:00
commit ea5a96fc8a

View file

@ -282,13 +282,13 @@ RSpec::Matchers.define :cmp do |first_expected|
end
failure_message do |actual|
actual = '0' + actual.to_s(8) if octal?(expected)
"\nexpected: value #{@operation} #{expected}\n got: #{actual}\n\n(compared using `cmp` matcher)\n"
actual = '0' + actual.to_s(8) if octal?(@expected)
"\nexpected: value #{@operation} #{@expected}\n got: #{actual}\n\n(compared using `cmp` matcher)\n"
end
failure_message_when_negated do |actual|
actual = '0' + actual.to_s(8) if octal?(expected)
"\nexpected: value ! #{@operation} #{expected}\n got: #{actual}\n\n(compared using `cmp` matcher)\n"
actual = '0' + actual.to_s(8) if octal?(@expected)
"\nexpected: value ! #{@operation} #{@expected}\n got: #{actual}\n\n(compared using `cmp` matcher)\n"
end
end