|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
| 3 | +# SimpleCov configuration *must* be loaded before any of the application code is required. |
| 4 | +unless ENV.fetch('RUBYMINE_SIMPLECOV_COVERAGE_PATH', nil) |
| 5 | + require 'simplecov' |
| 6 | + SimpleCov.start('rails') do |
| 7 | + add_group 'Errors', 'app/errors' |
| 8 | + add_group 'Policies', 'app/policies' |
| 9 | + add_group 'Services', 'app/services' |
| 10 | + add_group 'Validators', 'app/validators' |
| 11 | + end |
| 12 | +end |
| 13 | + |
3 | 14 | # This file was generated by the `rails generate rspec:install` command. Conventionally, all |
4 | 15 | # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. |
5 | 16 | # The generated `.rspec` file contains `--require spec_helper` which will cause |
|
19 | 30 | # |
20 | 31 | # See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration |
21 | 32 |
|
22 | | -unless ENV.fetch('RUBYMINE_SIMPLECOV_COVERAGE_PATH', nil) |
23 | | - require 'simplecov' |
24 | | - SimpleCov.start('rails') |
25 | | -end |
26 | | - |
27 | | -RSpec::Matchers.define_negated_matcher :avoid_change, :change |
28 | | -RSpec::Matchers.define_negated_matcher :not_include, :include |
29 | | -RSpec::Matchers.define_negated_matcher :not_have_attributes, :have_attributes |
30 | | -RSpec::Matchers.define_negated_matcher :not_eql, :eql |
31 | | - |
32 | 33 | RSpec.configure do |config| |
33 | 34 | # rspec-expectations config goes here. You can use an alternate |
34 | 35 | # assertion/expectation library such as wrong or the stdlib/minitest |
|
42 | 43 | # ...rather than: |
43 | 44 | # # => "be bigger than 2" |
44 | 45 | expectations.include_chain_clauses_in_custom_matcher_descriptions = true |
45 | | - |
46 | | - # Enable only the newer, non-monkey-patching expect syntax. |
47 | | - # For more details, see: |
48 | | - # - https://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ |
49 | | - expectations.syntax = :expect |
50 | 46 | end |
51 | 47 |
|
52 | 48 | # rspec-mocks config goes here. You can use an alternate test double |
53 | 49 | # library (such as bogus or mocha) by changing the `mock_with` option here. |
54 | 50 | config.mock_with :rspec do |mocks| |
55 | | - # Enable only the newer, non-monkey-patching expect syntax. |
56 | | - mocks.syntax = :expect |
57 | | - |
58 | 51 | # Prevents you from mocking or stubbing a method that does not exist on |
59 | 52 | # a real object. This is generally recommended, and will default to |
60 | 53 | # `true` in RSpec 4. |
61 | 54 | mocks.verify_partial_doubles = true |
62 | 55 | end |
63 | 56 |
|
64 | | - # These two settings work together to allow you to limit a spec run |
65 | | - # to individual examples or groups you care about by tagging them with |
66 | | - # `:focus` metadata. When nothing is tagged with `:focus`, all examples |
67 | | - # get run. |
68 | | - # config.filter_run :focus |
69 | | - # config.run_all_when_everything_filtered = true |
| 57 | + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will |
| 58 | + # have no way to turn it off -- the option exists only for backwards |
| 59 | + # compatibility in RSpec 3). It causes shared context metadata to be |
| 60 | + # inherited by the metadata hash of host groups and examples, rather than |
| 61 | + # triggering implicit auto-inclusion in groups with matching metadata. |
| 62 | + config.shared_context_metadata_behavior = :apply_to_host_groups |
| 63 | + |
| 64 | + # The settings below are suggested to provide a good initial experience |
| 65 | + # with RSpec, but feel free to customize to your heart's content. |
| 66 | + |
| 67 | + # This allows you to limit a spec run to individual examples or groups |
| 68 | + # you care about by tagging them with `:focus` metadata. When nothing |
| 69 | + # is tagged with `:focus`, all examples get run. RSpec also provides |
| 70 | + # aliases for `it`, `describe`, and `context` that include `:focus` |
| 71 | + # metadata: `fit`, `fdescribe` and `fcontext`, respectively. |
| 72 | + config.filter_run_when_matching :focus |
70 | 73 |
|
71 | 74 | # Allows RSpec to persist some state between runs in order to support |
72 | 75 | # the `--only-failures` and `--next-failure` CLI options. We recommend |
|
75 | 78 |
|
76 | 79 | # Limits the available syntax to the non-monkey patched syntax that is |
77 | 80 | # recommended. For more details, see: |
78 | | - # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax |
79 | | - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ |
80 | | - # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching |
| 81 | + # https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/ |
81 | 82 | config.disable_monkey_patching! |
82 | 83 |
|
83 | 84 | # Many RSpec users commonly either run the entire suite or an individual |
|
0 commit comments