Skip to content

Commit 45bd976

Browse files
sl4vrbquorning
authored andcommitted
Use config context for all cop specs
* Add shared context for all cop specs. * Remove redundant `config` metadata for cop specs. * Remove redundant `cop` subjects from cop specs.
1 parent 21e4cb7 commit 45bd976

File tree

86 files changed

+38
-141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+38
-141
lines changed

spec/rubocop/cop/rspec/align_left_let_brace_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::AlignLeftLetBrace do
4-
subject(:cop) { described_class.new }
5-
64
# rubocop:disable RSpec/ExampleLength
75
it 'registers offense for unaligned braces' do
86
expect_offense(<<-RUBY)

spec/rubocop/cop/rspec/align_right_let_brace_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::AlignRightLetBrace do
4-
subject(:cop) { described_class.new }
5-
64
# rubocop:disable RSpec/ExampleLength
75
it 'registers offense for unaligned braces' do
86
expect_offense(<<-RUBY)

spec/rubocop/cop/rspec/any_instance_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::AnyInstance do
4-
subject(:cop) { described_class.new }
5-
64
it 'finds `allow_any_instance_of` instead of an instance double' do
75
expect_offense(<<-RUBY)
86
before do

spec/rubocop/cop/rspec/around_block_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::AroundBlock do
4-
subject(:cop) { described_class.new }
5-
64
context 'when no value is yielded' do
75
it 'registers an offense' do
86
expect_offense(<<-RUBY)

spec/rubocop/cop/rspec/be_eql_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::BeEql do
4-
subject(:cop) { described_class.new }
5-
64
it 'registers an offense for `eql` when argument is a boolean' do
75
expect_offense(<<-RUBY)
86
it { expect(foo).to eql(true) }

spec/rubocop/cop/rspec/be_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::Be do
4-
subject(:cop) { described_class.new }
5-
64
it 'registers an offense for `be` without an argument' do
75
expect_offense(<<-RUBY)
86
it { expect(foo).to be }

spec/rubocop/cop/rspec/before_after_all_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::BeforeAfterAll do
4-
subject(:cop) { described_class.new }
5-
64
def message(hook)
75
"Beware of using `#{hook}` as it may cause state to leak between tests. "\
86
'If you are using `rspec-rails`, and `use_transactional_fixtures` is '\

spec/rubocop/cop/rspec/capybara/current_path_expectation_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation do
4-
subject(:cop) { described_class.new }
5-
64
it 'flags violations for `expect(current_path)`' do
75
expect_offense(<<-RUBY)
86
expect(current_path).to eq("/callback")

spec/rubocop/cop/rspec/capybara/feature_methods_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
RSpec.describe RuboCop::Cop::RSpec::Capybara::FeatureMethods, :config do
3+
RSpec.describe RuboCop::Cop::RSpec::Capybara::FeatureMethods do
44
it 'flags violations for `background`' do
55
expect_offense(<<-RUBY)
66
describe 'some feature' do

spec/rubocop/cop/rspec/capybara/visibility_matcher_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# frozen_string_literal: true
22

33
RSpec.describe RuboCop::Cop::RSpec::Capybara::VisibilityMatcher do
4-
subject(:cop) { described_class.new }
5-
64
it 'registers an offense when using `visible: true`' do
75
expect_offense(<<-RUBY)
86
expect(page).to have_selector('.my_element', visible: true)

0 commit comments

Comments
 (0)