Skip to content

Commit

Permalink
Merge pull request #400 from alphagov/kevindew-patch-1
Browse files Browse the repository at this point in the history
Disable RSpec/NoExpectationExample for feature/system specs
  • Loading branch information
kevindew committed Jun 26, 2024
2 parents 6f199ed + e46452a commit a1e3489
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 5.0.1

- Disable RSpec/NoExpectationExample for feature and system specs as it false triggers.

# 5.0.0

- BREAKING: Update rubocop-rspec to 3.0 which enables by default previously pending cops. See [rubocop-rspec's changelog](https://github.com/rubocop/rubocop-rspec/blob/master/CHANGELOG.md#300-2024-06-11) for details.
Expand Down
9 changes: 8 additions & 1 deletion config/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ RSpec/InstanceVariable:
- 'spec/features/**/*.rb'
- 'spec/system/**/*.rb'

# The GOV.UK Feature spec style has expectations in method calls so this
# cop falsely triggers.
RSpec/NoExpectationExample:
Exclude:
- 'spec/features/**/*.rb'
- 'spec/system/**/*.rb'

# In GOV.UK we quite often test that a class received a method.
RSpec/MessageSpies:
Enabled: false
Expand All @@ -56,7 +63,7 @@ RSpec/ContextWording:
# scenario.
# We don't want this cop outside of feature or system specs though.
RSpec/Dialect:
# Disables all Capybara-specific methods that have the same native
# Disables all Capybara-specific methods that have the same native
# RSpec method (e.g. are just aliases)
PreferredMethods:
background: :before
Expand Down
2 changes: 1 addition & 1 deletion rubocop-govuk.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = "rubocop-govuk"
spec.version = "5.0.0"
spec.version = "5.0.1"
spec.authors = ["Government Digital Service"]
spec.email = ["govuk-dev@digital.cabinet-office.gov.uk"]

Expand Down

0 comments on commit a1e3489

Please sign in to comment.