|
6 | 6 | # Given that it is always loaded, you are encouraged to keep this file as |
7 | 7 | # light-weight as possible. Requiring heavyweight dependencies from this file |
8 | 8 | # will add to the boot time of your test suite on EVERY test run, even for an |
9 | | -# individual file that may not need all of that loaded. Instead, make a |
10 | | -# separate helper file that requires this one and then use it only in the specs |
11 | | -# that actually need it. |
| 9 | +# individual file that may not need all of that loaded. Instead, consider making |
| 10 | +# a separate helper file that requires the additional dependencies and performs |
| 11 | +# the additional setup, and require it from the spec files that actually need it. |
12 | 12 | # |
13 | 13 | # The `.rspec` file also contains a few flags that are not defaults but that |
14 | 14 | # users commonly want. |
|
21 | 21 | Dir["#{root_dir}/lib/**/*.rb"].each { |f| require f } |
22 | 22 |
|
23 | 23 | RSpec.configure do |config| |
| 24 | + # rspec-expectations config goes here. You can use an alternate |
| 25 | + # assertion/expectation library such as wrong or the stdlib/minitest |
| 26 | + # assertions if you prefer. |
| 27 | + config.expect_with :rspec do |expectations| |
| 28 | + # This option will default to `true` in RSpec 4. It makes the `description` |
| 29 | + # and `failure_message` of custom matchers include text for helper methods |
| 30 | + # defined using `chain`, e.g.: |
| 31 | + # be_bigger_than(2).and_smaller_than(4).description |
| 32 | + # # => "be bigger than 2 and smaller than 4" |
| 33 | + # ...rather than: |
| 34 | + # # => "be bigger than 2" |
| 35 | + expectations.include_chain_clauses_in_custom_matcher_descriptions = true |
| 36 | + end |
| 37 | + |
| 38 | + # rspec-mocks config goes here. You can use an alternate test double |
| 39 | + # library (such as bogus or mocha) by changing the `mock_with` option here. |
| 40 | + config.mock_with :rspec do |mocks| |
| 41 | + # Prevents you from mocking or stubbing a method that does not exist on |
| 42 | + # a real object. This is generally recommended, and will default to |
| 43 | + # `true` in RSpec 4. |
| 44 | + mocks.verify_partial_doubles = true |
| 45 | + end |
| 46 | + |
24 | 47 | # The settings below are suggested to provide a good initial experience |
25 | 48 | # with RSpec, but feel free to customize to your heart's content. |
26 | 49 | =begin |
|
31 | 54 | config.filter_run :focus |
32 | 55 | config.run_all_when_everything_filtered = true |
33 | 56 |
|
| 57 | + # Limits the available syntax to the non-monkey patched syntax that is recommended. |
| 58 | + # For more details, see: |
| 59 | + # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax |
| 60 | + # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ |
| 61 | + # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching |
| 62 | + config.disable_monkey_patching! |
| 63 | +
|
| 64 | + # This setting enables warnings. It's recommended, but in some cases may |
| 65 | + # be too noisy due to issues in dependencies. |
| 66 | + config.warnings = true |
| 67 | +
|
34 | 68 | # Many RSpec users commonly either run the entire suite or an individual |
35 | 69 | # file, and it's useful to allow more verbose output when running an |
36 | 70 | # individual spec file. |
|
57 | 91 | # test failures related to randomization by passing the same `--seed` value |
58 | 92 | # as the one that triggered the failure. |
59 | 93 | Kernel.srand config.seed |
60 | | -
|
61 | | - # rspec-expectations config goes here. You can use an alternate |
62 | | - # assertion/expectation library such as wrong or the stdlib/minitest |
63 | | - # assertions if you prefer. |
64 | | - config.expect_with :rspec do |expectations| |
65 | | - # Enable only the newer, non-monkey-patching expect syntax. |
66 | | - # For more details, see: |
67 | | - # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax |
68 | | - expectations.syntax = :expect |
69 | | - end |
70 | | -
|
71 | | - # rspec-mocks config goes here. You can use an alternate test double |
72 | | - # library (such as bogus or mocha) by changing the `mock_with` option here. |
73 | | - config.mock_with :rspec do |mocks| |
74 | | - # Enable only the newer, non-monkey-patching expect syntax. |
75 | | - # For more details, see: |
76 | | - # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ |
77 | | - mocks.syntax = :expect |
78 | | -
|
79 | | - # Prevents you from mocking or stubbing a method that does not exist on |
80 | | - # a real object. This is generally recommended. |
81 | | - mocks.verify_partial_doubles = true |
82 | | - end |
83 | 94 | =end |
84 | 95 | end |
0 commit comments