Add configuration instructions for RSpec timeout
This commit is contained in:
parent
aad1624541
commit
e07442766d
1 changed files with 16 additions and 0 deletions
16
README.md
16
README.md
|
@ -48,6 +48,22 @@ mutant --include lib --require virtus --use rspec Virtus::Attribute.build
|
|||
mutant --include lib --require virtus --use rspec Virtus::Attribute#type
|
||||
```
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
Occasionally mutant will produce a mutation with an infinite runtime. When this happens
|
||||
mutant will look like it is running indefinitely without killing a remaining mutation. To
|
||||
avoid mutations like this, consider adding a timeout around your tests. For example, in
|
||||
RSpec you can add the following to your `spec_helper`:
|
||||
|
||||
```ruby
|
||||
config.around(:each) do |example|
|
||||
Timeout.timeout(5_000, &example)
|
||||
end
|
||||
```
|
||||
|
||||
which will fail specs which run for longer than 5 seconds.
|
||||
|
||||
Rails
|
||||
-------
|
||||
|
||||
|
|
Loading…
Reference in a new issue