|
5 | 5 | # 1. Add shoulda-matchers to Gemfile:
|
6 | 6 | #
|
7 | 7 | # group :test do
|
8 |
| -# gem 'shoulda-matchers', require: false |
| 8 | +# gem 'shoulda-matchers', '3.0.0.rc1' |
9 | 9 | # end
|
10 | 10 | #
|
11 | 11 | # 2. Create a file like this one you're reading in spec/support/shoulda_matchers.rb:
|
12 |
| -require 'shoulda/matchers' |
13 |
| - |
| 12 | +Shoulda::Matchers.configure do |config| |
| 13 | + config.integrate do |with| |
| 14 | + with.test_framework :rspec |
| 15 | + |
| 16 | + # Choose one or more libraries: |
| 17 | + # with.library :active_record |
| 18 | + # with.library :active_model |
| 19 | + # with.library :action_controller |
| 20 | + # Or, choose the following (which implies all of the above): |
| 21 | + with.library :rails |
| 22 | + end |
| 23 | +end |
14 | 24 |
|
15 | 25 | # 3. Start using shoulda-matchers. See specs in this project for examples.
|
16 | 26 |
|
17 | 27 | # Suggested docs
|
18 | 28 | # --------------
|
19 | 29 | # https://gist.github.com/kyletcarlson/6234923
|
20 | 30 | # https://github.com/thoughtbot/shoulda-matchers#rspec
|
| 31 | +# https://github.com/thoughtbot/shoulda-matchers#configuration |
21 | 32 | # https://github.com/thoughtbot/shoulda-matchers#activemodel-matchers
|
22 |
| -# http://thoughtbot.github.io/shoulda-matchers/v2.7.0/ |
23 |
| -# http://thoughtbot.github.io/shoulda-matchers/v2.7.0/Shoulda/Matchers/ActiveModel.html |
24 |
| -# http://thoughtbot.github.io/shoulda-matchers/v2.7.0/Shoulda/Matchers/ActiveRecord.html |
| 33 | +# http://thoughtbot.github.io/shoulda-matchers/ |
| 34 | +# http://thoughtbot.github.io/shoulda-matchers/docs/v3.0.0.rc1/ |
| 35 | +# http://thoughtbot.github.io/shoulda-matchers/docs/v3.0.0.rc1/Shoulda/Matchers/ActiveModel.html |
| 36 | +# http://thoughtbot.github.io/shoulda-matchers/docs/v3.0.0.rc1/Shoulda/Matchers/ActiveRecord.html |
0 commit comments