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

Add option for MultipleExpectation to special case aggregate_failures #233

Closed
backus opened this issue Nov 2, 2016 · 3 comments
Closed

Comments

@backus
Copy link
Collaborator

backus commented Nov 2, 2016

As @JonRowe mentioned in #228, the general guideline is to have "one business rule expectation" per spec. Sometimes this isn't always possible with a single expect(...). It would be nice to support something like

aggregate_failures("verifying response") do
  expect(response.status).to eq(200)
  expect(response.headers).to include("Content-Type" => "text/plain")
  expect(response.body).to include("Success")
end

being treated as one expectation

@JonRowe
Copy link

JonRowe commented Nov 2, 2016

Great way to represent it.

@Darhazer
Copy link
Member

I think there should be an option for MaxAggregatedExpectations as even with aggregate_failures 10 expectations might be too much.

Also an option may determine if RSpec/MultipleExpectation recommends using aggregate_failures when there is more then whatever the maximum expectations are set. With such recommendation, it is possible to implement an autocorrect as well.

@backus
Copy link
Collaborator Author

backus commented Mar 24, 2017

This was implemented in #329

@backus backus closed this as completed Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants