diff --git a/CHANGELOG.md b/CHANGELOG.md index 31c14c609..51325954d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Fix `RSpec/FactoryBot/ConsistentParenthesesStyle` to ignore calls without the first positional argument. ([@pirj]) - Fix `RSpec/FactoryBot/ConsistentParenthesesStyle` to ignore calls inside a Hash or an Array. ([@pirj]) - Fix `RSpec/NestedGroups` to correctly use `AllowedGroups` config. ([@samrjenkins]) +- Remove `Runners` and `HookScopes` RSpec DSL elements from configuration. ([@pirj]) ## 2.14.2 (2022-10-25) diff --git a/config/default.yml b/config/default.yml index 992e30424..a69408f87 100644 --- a/config/default.yml +++ b/config/default.yml @@ -12,8 +12,6 @@ RSpec: - Expectations - Helpers - Hooks - - HookScopes - - Runners - Subjects ExampleGroups: inherit_mode: @@ -81,12 +79,6 @@ RSpec: - prepend_after - after - append_after - HookScopes: - - each - - example - - context - - all - - suite Includes: inherit_mode: merge: @@ -98,10 +90,6 @@ RSpec: - include_examples Context: - include_context - Runners: - - to - - to_not - - not_to SharedGroups: inherit_mode: merge: diff --git a/lib/rubocop/rspec/language.rb b/lib/rubocop/rspec/language.rb index 8e9461ac8..382882ad0 100644 --- a/lib/rubocop/rspec/language.rb +++ b/lib/rubocop/rspec/language.rb @@ -135,8 +135,9 @@ def self.all(element) end module HookScopes # :nodoc: + ALL = %i[each example context all suite].freeze def self.all(element) - Language.config['HookScopes'].include?(element.to_s) + ALL.include?(element) end end @@ -158,8 +159,9 @@ def context(element) end module Runners # :nodoc: + ALL = %i[to to_not not_to].freeze def self.all(element) - Language.config['Runners'].include?(element.to_s) + ALL.include?(element) end end