-
Notifications
You must be signed in to change notification settings - Fork 265
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
Pass a block to expect instead of a lambda #362
Pass a block to expect instead of a lambda #362
Conversation
Since rspec/rspec-expectations@771da6d rspec will raise if you pass a value trying to use the block expectation.
@uri.route_from("http://example.com/") | ||
end).to raise_error(ArgumentError, /\/\/example.com\//) | ||
end.to raise_error(ArgumentError, /\/\/example.com\//) |
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.
Style/RegexpLiteral: Use %r around regular expression.
@uri.route_to("http://example.com/") | ||
end).to raise_error(ArgumentError, /\/\/example.com\//) | ||
expect(lambda do | ||
end.to raise_error(ArgumentError, /\/\/example.com\//) |
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.
Style/RegexpLiteral: Use %r around regular expression.
@uri.route_from("http://example.com/") | ||
end).to raise_error(ArgumentError, /relative\/path\/to\/resource/) | ||
end.to raise_error(ArgumentError, /relative\/path\/to\/resource/) |
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.
Style/RegexpLiteral: Use %r around regular expression.
@uri.route_to("http://example.com/") | ||
end).to raise_error(ArgumentError, /relative\/path\/to\/resource/) | ||
expect(lambda do | ||
end.to raise_error(ArgumentError, /relative\/path\/to\/resource/) |
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.
Style/RegexpLiteral: Use %r around regular expression.
The change in rspec-expectations has been reverted, it was released in 3.8.5 but rolled back in 3.8.6. But the change here still might make sense? |
I think they do. At least we are saving a few characters 😄 |
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.
👍
Since rspec/rspec-expectations@771da6d rspec will raise if you pass a value trying to use the block expectation.