spec/rubocop/cop/rspec/repeated_example_spec.rb in rubocop-rspec-1.15.1 vs spec/rubocop/cop/rspec/repeated_example_spec.rb in rubocop-rspec-1.16.0

- old
+ new

@@ -2,11 +2,11 @@ RSpec.describe RuboCop::Cop::RSpec::RepeatedExample do subject(:cop) { described_class.new } it 'registers an offense for repeated example' do - expect_violation(<<-RUBY) + expect_offense(<<-RUBY) describe 'doing x' do it "does x" do ^^^^^^^^^^^^^^ Don't repeat examples within an example group. expect(foo).to be(bar) end @@ -18,11 +18,11 @@ end RUBY end it 'does not register a violation if rspec tag magic is involved' do - expect_no_violations(<<-RUBY) + expect_no_offenses(<<-RUBY) describe 'doing x' do it "does x" do expect(foo).to be(bar) end @@ -32,11 +32,11 @@ end RUBY end it 'does not flag examples with different implementations' do - expect_no_violations(<<-RUBY) + expect_no_offenses(<<-RUBY) describe 'doing x' do it "does x" do expect(foo).to have_attribute(foo: 1) end @@ -46,19 +46,19 @@ end RUBY end it 'does not flag examples when different its arguments are used' do - expect_no_violations(<<-RUBY) + expect_no_offenses(<<-RUBY) describe 'doing x' do its(:x) { is_expected.to be_present } its(:y) { is_expected.to be_present } end RUBY end it 'does not flag repeated examples in different scopes' do - expect_no_violations(<<-RUBY) + expect_no_offenses(<<-RUBY) describe 'doing x' do it "does x" do expect(foo).to be(bar) end