spec/rubocop/cop/rspec/instance_variable_spec.rb in rubocop-rspec-1.28.0 vs spec/rubocop/cop/rspec/instance_variable_spec.rb in rubocop-rspec-1.29.0
- old
+ new
@@ -4,11 +4,11 @@
it 'finds an instance variable inside a describe' do
expect_offense(<<-RUBY)
describe MyClass do
before { @foo = [] }
it { expect(@foo).to be_empty }
- ^^^^ Use `let` instead of an instance variable.
+ ^^^^ Replace instance variable with local variable or `let`.
end
RUBY
end
it 'ignores non-spec blocks' do
@@ -22,11 +22,11 @@
it 'finds an instance variable inside a shared example' do
expect_offense(<<-RUBY)
shared_examples 'shared example' do
it { expect(@foo).to be_empty }
- ^^^^ Use `let` instead of an instance variable.
+ ^^^^ Replace instance variable with local variable or `let`.
end
RUBY
end
it 'ignores an instance variable without describe' do
@@ -75,10 +75,10 @@
it 'flags an instance variable when it is also assigned' do
expect_offense(<<-RUBY)
describe MyClass do
before { @foo = [] }
it { expect(@foo).to be_empty }
- ^^^^ Use `let` instead of an instance variable.
+ ^^^^ Replace instance variable with local variable or `let`.
end
RUBY
end
it 'ignores an instance variable when it is not assigned' do