Skip to content
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

Merged
merged 2 commits into from
Jul 3, 2021

Conversation

rafaelfranca
Copy link
Contributor

Since rspec/rspec-expectations@771da6d rspec will raise if you pass a value trying to use the block expectation.

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\//)
Copy link
Collaborator

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\//)
Copy link
Collaborator

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/)
Copy link
Collaborator

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/)
Copy link
Collaborator

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.

@dentarg
Copy link
Collaborator

dentarg commented Oct 8, 2019

Since rspec/rspec-expectations@771da6d rspec will raise if you pass a value trying to use the block expectation.

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?

@rafaelfranca
Copy link
Contributor Author

I think they do. At least we are saving a few characters 😄

pirj
pirj previously approved these changes Oct 13, 2019
Copy link

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@sporkmonger sporkmonger changed the base branch from master to main July 3, 2021 03:41
@sporkmonger sporkmonger merged commit 6af2520 into sporkmonger:main Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants