-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use expect() instead of .should #45
Conversation
64817de
to
350304b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be_false should be replaced by be_nil
spec/lib/augeas_spec/fixtures.rb
Outdated
|
|
||
| # Check for transaction success after, as it's less informative | ||
| txn.any_failed?.should_not eq(true) | ||
| expect(txn.any_failed?).to be_false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| expect(txn.any_failed?).to be_false | |
| expect(txn.any_failed?).to be_nil |
spec/lib/augeas_spec/fixtures.rb
Outdated
| againlogs.should eq([]), "expected no change on second run (idempotence check),\n got: #{againlogs.inspect}" | ||
| txn_idempotent.any_failed?.should_not eq(true), 'expected no change on second run (idempotence check), got a resource failure' | ||
| expect(againlogs).to eq([]), 'expected no change on second run (idempotence check)' | ||
| expect(txn_idempotent.any_failed?).to be_false, 'expected no change on second run (idempotence check), got a resource failure' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check should be comparing to be_nil
| expect(txn_idempotent.any_failed?).to be_false, 'expected no change on second run (idempotence check), got a resource failure' | |
| expect(txn_idempotent.any_failed?).to be_nil, 'expected no change on second run (idempotence check), got a resource failure' |
|
Interesting. I looked at the implementation (https://github.com/puppetlabs/puppet/blob/aa05e8df814b8a6655b33ebf25c3fe0915c8f0d5/lib/puppet/transaction.rb#L213-L218) and that uses |
This removes deprecation warnings from the process output. It also uses eq([]) instead of be_empty since it's easier to debug: the diff is more useful.
350304b
to
9e3d0e5
Compare
This removes deprecation warnings from the process output.
It also uses eq([]) instead of be_empty since it's easier to debug: the diff is more useful.