Skip to content

Commit 2442dda

Browse files
committed
Use a better matcher in tests
This provides a better failure message.
1 parent 91c19d8 commit 2442dda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spec/unit/util/logging_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def run(exception_class)
455455
expect(log.message).to_not match('/logging_spec.rb')
456456
expect(log.backtrace[0]).to match('/logging_spec.rb')
457457

458-
expect(log.backtrace.any? { |l| l =~ /\/tmp\/test2\.pp:20/ }).to be true
458+
expect(log.backtrace).to include(/\/tmp\/test2\.pp:20/)
459459
puppetstack = log.backtrace.select { |l| l =~ /tmp\/test\d\.pp/ }
460460

461461
expect(puppetstack.length).to eq(3)

0 commit comments

Comments
 (0)