spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb in rubocop-rspec-1.17.1 vs spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb in rubocop-rspec-1.18.0

- old
+ new

@@ -41,9 +41,19 @@ RSpec.feature 'Foo' do; end ^^^^^^^ Use `describe` instead of `feature`. RUBY end + it 'ignores variables inside examples' do + expect_no_offenses(<<-RUBY) + it 'is valid code' do + given(feature) + assign(background) + run scenario + end + RUBY + end + include_examples 'autocorrect', 'background { }', 'before { }' include_examples 'autocorrect', 'scenario { }', 'it { }' include_examples 'autocorrect', 'xscenario { }', 'xit { }' include_examples 'autocorrect', 'given(:foo) { }', 'let(:foo) { }' include_examples 'autocorrect', 'given!(:foo) { }', 'let!(:foo) { }'