Skip to content

Commit

Permalink
Setup for rerunning rspec failures
Browse files Browse the repository at this point in the history
  • Loading branch information
martent committed Aug 16, 2019
1 parent 0d7a377 commit f78474c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/config/deploy/staging.rb
/config/deploy/production.rb
.byebug_history
.rspec-failures

.DS_Store
/.bundle
Expand All @@ -20,5 +21,6 @@
# Ignore encrypted secrets key file.
config/secrets.yml.key
config/secrets.yml.enc

*.sql
/lab
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,13 @@ Note: Installation of Chrome, ChromeDriver and Selenium are currently not provid
Run the test cases in the projects root directory in your Vagrant box:

```shell
$ bundle exec rspec --exclude-pattern ./spec/unit/extra_contribution_cost_spec.rb --exclude-pattern ./spec/unit/family_and_emergency_home_cost_spec.rb --exclude-pattern ./spec/features/placements_spec.rb
$ bundle exec rspec ./spec/unit/extra_contribution_cost_spec.rb ./spec/unit/family_and_emergency_home_cost_spec.rb ./spec/features/placements_spec.rb
$ bundle exec rspec
```
Currently, if some tests fail, you may want to execute a second run as you see above. This is because an rspec order issue that hasn't been tracked down yet.

```shell
$ bundle exec rspec --only-failures
```
Currently, rspec must be executed in two separate runs as you see above. This is because an rspec order issue that hasn't been tracked down yet.

Note that the environment used for RSpec is `local_test`.

Expand Down
2 changes: 2 additions & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@

config.order = :random

config.example_status_persistence_file_path = '.rspec-failures'

# From old spec_helper
config.expect_with :rspec do |expectations|
# This option will default to `true` in RSpec 4. It makes the `description`
Expand Down

0 comments on commit f78474c

Please sign in to comment.