Class: RuboCop::Cop::RSpec::Capybara::FeatureMethods
- Inherits:
-
RuboCop::Cop::RSpec::Cop
- Object
- WorkaroundCop
- RuboCop::Cop::RSpec::Cop
- RuboCop::Cop::RSpec::Capybara::FeatureMethods
- Defined in:
- lib/rubocop/cop/rspec/capybara/feature_methods.rb
Overview
Checks for consistent method usage in feature specs.
Constant Summary collapse
- MSG =
'Use `%<replacement>s` instead of `%<method>s`.'.freeze
- MAP =
{ background: :before, scenario: :it, xscenario: :xit, given: :let, given!: :let!, feature: :describe }.freeze
Constants inherited from RuboCop::Cop::RSpec::Cop
RuboCop::Cop::RSpec::Cop::DEFAULT_CONFIGURATION, RuboCop::Cop::RSpec::Cop::DEFAULT_PATTERN_RE
Constants included from RSpec::Language
Instance Method Summary collapse
Methods inherited from RuboCop::Cop::RSpec::Cop
Instance Method Details
#autocorrect(node) ⇒ Object
64 65 66 67 68 |
# File 'lib/rubocop/cop/rspec/capybara/feature_methods.rb', line 64 def autocorrect(node) lambda do |corrector| corrector.replace(node.loc.selector, MAP[node.method_name].to_s) end end |