Merge pull request #249 from tansaku/patch-1
Notes for working with rails
This commit is contained in:
commit
63abd667f4
1 changed files with 18 additions and 0 deletions
18
README.md
18
README.md
|
@ -146,6 +146,24 @@ Example for a subject like `Foo::Bar#baz` it will run all example groups with de
|
||||||
`Foo::Bar#baz`, `Foo::Bar` and `Foo`. The order is important, so if mutant finds example groups in the
|
`Foo::Bar#baz`, `Foo::Bar` and `Foo`. The order is important, so if mutant finds example groups in the
|
||||||
current prefix level, these example groups *must* kill the mutation.
|
current prefix level, these example groups *must* kill the mutation.
|
||||||
|
|
||||||
|
Rails
|
||||||
|
-------
|
||||||
|
|
||||||
|
Assuming you are using rspec, you can mutation test Rails models by adding the following lines to your Gemfile:
|
||||||
|
|
||||||
|
```ruby
|
||||||
|
group :test do
|
||||||
|
gem 'mutant'
|
||||||
|
gem 'mutant-rspec'
|
||||||
|
end
|
||||||
|
```
|
||||||
|
|
||||||
|
Next, run bundle and comment out ```require 'rspec/autorun'``` from your spec_helper.rb file. Having done so you should be able to use commands like the following:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
RAILS_ENV=test mutant -r ./config/environment --use rspec User
|
||||||
|
```
|
||||||
|
|
||||||
Support
|
Support
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue