Skip to content

Commit

Permalink
Fix Style/HashExcept cop
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Nov 3, 2024
1 parent c3a8361 commit 6d2f4ea
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions test/standard/rails_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ def test_that_it_has_a_version_number
VersionAdded
VersionChanged
].freeze
REMOVED_COPS = %w[
Lint/NumberConversion
Lint/RedundantSafeNavigation
Style/AndOr
Style/CollectionCompact
Style/FormatStringToken
Style/InvertibleUnlessCondition
Style/SymbolProc
]
def test_configures_all_rails_cops
expected = YAML.load_file(Pathname.new(Gem.loaded_specs["rubocop-rails"].full_gem_path).join("config/default.yml")).reject { |name, cop|
["Lint/NumberConversion", "Style/AndOr", "Style/FormatStringToken", "Style/SymbolProc", "Lint/RedundantSafeNavigation", "Style/InvertibleUnlessCondition", "Style/CollectionCompact"].include?(name)
}.to_h
expected = YAML.load_file(Pathname.new(Gem.loaded_specs["rubocop-rails"].full_gem_path).join("config/default.yml")).except(*REMOVED_COPS).to_h
actual = YAML.load_file(BASE_CONFIG)
missing = (expected.keys - actual.keys).grep(/\//) # ignore groups like "Layout"
extra = actual.keys - expected.keys - ["require"]
Expand Down

0 comments on commit 6d2f4ea

Please sign in to comment.