Skip to content

Commit

Permalink
Add ContextWorking cop
Browse files Browse the repository at this point in the history
Resolves #417
Fixes #751
Supersedes #751
  • Loading branch information
geniou authored and pirj committed Aug 18, 2019
1 parent 8e26583 commit 265d896
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Fix `RSpec/DescribedClass`'s error when a `described_class` is part of the namespace. ([@pirj][])
* Fix `RSpec/ExampleWording` autocorrect of multi-line docstrings. ([@pirj][])
* Add `RSpec/ContextMethod` cop, to detect method names in `context`. ([@geniou][])

## 1.35.0 (2019-08-02)

Expand Down
5 changes: 5 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ RSpec/BeforeAfterAll:
- spec/support/**/*.rb
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeforeAfterAll

RSpec/ContextMethod:
Description: "`context` should not be used for specifying methods."
Enabled: true
StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextMethod

RSpec/ContextWording:
Description: Checks that `context` docstring starts with an allowed prefix.
Enabled: true
Expand Down
1 change: 1 addition & 0 deletions lib/rubocop/cop/capybara_cops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
require_relative 'rspec/be'
require_relative 'rspec/be_eql'
require_relative 'rspec/before_after_all'
require_relative 'rspec/context_method'
require_relative 'rspec/context_wording'
require_relative 'rspec/describe_class'
require_relative 'rspec/describe_method'
Expand Down

0 comments on commit 265d896

Please sign in to comment.