spec/rubocop/cop/rspec/example_wording_spec.rb in rubocop-rspec-1.6.0 vs spec/rubocop/cop/rspec/example_wording_spec.rb in rubocop-rspec-1.7.0
- old
+ new
@@ -43,22 +43,40 @@
end
RUBY
end
it 'corrects `it "should only have"` to it "only has"' do
- corrected = autocorrect_source(cop, 'it "should only have trait" do end')
+ corrected =
+ autocorrect_source(
+ cop,
+ 'it "should only have trait" do end',
+ 'spec/foo_spec.rb'
+ )
+
expect(corrected).to eql('it "only has trait" do end')
end
end
context 'when configuration is empty' do
it 'only does not correct "have"' do
- corrected = autocorrect_source(cop, 'it "should have trait" do end')
+ corrected =
+ autocorrect_source(
+ cop,
+ 'it "should have trait" do end',
+ 'spec/foo_spec.rb'
+ )
+
expect(corrected).to eql('it "haves trait" do end')
end
it 'only does not make an exception for the word "only"' do
- corrected = autocorrect_source(cop, 'it "should only fail" do end')
+ corrected =
+ autocorrect_source(
+ cop,
+ 'it "should only fail" do end',
+ 'spec/foo_spec.rb'
+ )
+
expect(corrected).to eql('it "onlies fail" do end')
end
end
end