mirror of
https://github.com/inspec/inspec
synced 2024-12-11 22:02:47 +00:00
6381dd1b1d
This modifies the output of failed test when using the `cmp` matcher by calling `.inspect` on the actual value passed. This makes it easier to diagnose failed matches due to characters such as `\n` not being visible. Current behavior: ``` inspec> describe command('echo demo') do inspec> its('stdout') { should cmp 'demo' } inspec> end Profile: inspec-shell Version: (not specified) Command: `echo demo` × stdout should cmp == "demo" expected: "demo" got: demo (compared using `cmp` matcher) Test Summary: 0 successful, 1 failure, 0 skipped ``` New behavior: ``` inspec> describe command('echo demo') do inspec> its('stdout') { should cmp 'demo' } inspec> end Profile: inspec-shell Version: (not specified) Command: `echo demo` × stdout should cmp == "demo" expected: "demo" got: "demo\n" (compared using `cmp` matcher) Test Summary: 0 successful, 1 failure, 0 skipped ``` Many thanks to @jazaval for discovering this! Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com> |
||
---|---|---|
.. | ||
matchers.rb |