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

Clear RSpec examples without shared examples in similar way as in RSpec 3.6.0 #42

Merged
merged 3 commits into from
Jun 11, 2017

Conversation

ArturT
Copy link
Member

@ArturT ArturT commented Jun 10, 2017

This should fix Queue Mode for RSpec. This change is based on changes introduced in RSpec 3.6.0 related to the feature:

"Running specs multiple times with different runner options in the same process"
https://relishapp.com/rspec-staging/rspec-core/docs/running-specs-multiple-times-with-different-runner-options-in-the-same-process

rspec/rspec-core#2379

General context

  • RSpec.clear_examples in rspec 3.6.0 clears examples without shared examples. That's good because we want to have loaded shared examples between rspec runs.

  • RSpec.clear_examples in rspec < 3.6.0 clears examples and shared examples. That's bad because the tests fails because shared examples are not loaded.

RSpec.clear_examples does an additional thing which is cleared formatters and report. We don't want that because we want to accumulate info about failed/pending tests so we can show at the very end of Queue Mode output the info about summary of tests (what failed and what's pending).

Solution

Instead of using RSpec.clear_examples we do exactly the same thing as the RSpec.clear_examples method in rspec 3.6.0 except we don't clear formatters and report.

RSpec.clear_examples except we keep the formatters and report so we are
able to accumulate info about failed/pending tests
@ArturT ArturT changed the title Clear RSpec examples without shared examples Clear RSpec examples without shared examples in similar way as in RSpec 3.6.0 Jun 10, 2017
@ArturT ArturT merged commit db31793 into master Jun 11, 2017
@ArturT ArturT deleted the queue-clear-rspec-examples-3 branch June 11, 2017 09:10
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.

None yet

1 participant