-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Suppress RSspec deprecation warnings #1631
Conversation
This change suppresses the following deprecation warning: ``` The implicit block expectation syntax is deprecated, you should pass a block rather than an argument to `expect` to use the provided block expectation matcher or the matcher must implement `supports_value_expectations?`. e.g `expect { value }.to change `step_args.first`` not `expect(value).to change `step_args.first`` ```
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.
Quick query, rest seems ok
@@ -24,5 +24,5 @@ | |||
end | |||
|
|||
Then(/il risultato deve essere (\d*)/) do |result| | |||
@result.should == result.to_i | |||
expect(@result).to eq(result.to_f) |
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.
Is there a reason you've altered these from integers to floats?
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.
I just copied it from other calculator_steps.rb
for consistency.
e.g.
cucumber-ruby/examples/i18n/en/features/step_definitions/calculator_steps.rb
Lines 19 to 21 in 2b64167
Then(/the result should be (.*) on the screen/) do |result| | |
expect(@result).to eq(result.to_f) | |
end |
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.
Ah, I looked at each of the features carefully, and it seems that they are expecting an Integer, not a Float.
I will fix them. Thank you for pointing them out!
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.
Thanks @mishina2228 👍
This change suppresses the following deprecation warning: ``` DEPRECATION: Using `should` from rspec-expectations' old `:should` syntax without explicitly enabling the syntax is deprecated. Use the new `:expect` syntax or explicitly enable `:should` with `config.expect_with(:rspec) { |c| c.syntax = :should }` instead. Called from /Users/runner/work/cucumber-ruby/cucumber-ruby/examples/i18n/sv/features/step_definitions/kalkulator_steps.rb:27:in `block in <top (required)>'. ```
9a826a3
to
80b7723
Compare
Description
This PR suppresses the following RSpec deprecation warnings.
Pass a block instead of a lambda to
expect
Replace deprecated
should
with RSpec3'sexpect
Type of change
Checklist:
bundle exec rubocop
reports no offenses