Skip to content

Commit

Permalink
Merge pull request #1878 from rubocop/clean-this-and-that
Browse files Browse the repository at this point in the history
Fix a few minor things
  • Loading branch information
ydah authored May 6, 2024
2 parents 4bc411b + 0de7903 commit 7ff7552
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ Layout/LineLength:
Max: 80 # default: 120
AllowedPatterns:
- '^\s*# .*https?:\/\/.+\[.+\]\.?$' # Allow long asciidoc links
Exclude:
- lib/rubocop/cop/rspec/rails/have_http_status.rb

Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Expand Down Expand Up @@ -113,6 +111,7 @@ RSpec/DescribeClass:
RSpec/MultipleExpectations:
Max: 2

# `expect_offense` does not use Kernel#format or String#%
Style/FormatStringToken:
Exclude:
- spec/rubocop/**/*.rb
Expand Down
12 changes: 6 additions & 6 deletions spec/rubocop/cop/rspec/repeated_subject_call_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe RuboCop::Cop::RSpec::RepeatedSubjectCall do
it 'registers an offense when a singular block' do
expect_offense(<<-RUBY)
expect_offense(<<~RUBY)
RSpec.describe Foo do
it do
subject
Expand All @@ -14,7 +14,7 @@
end

it 'registers an offense when repeated blocks' do
expect_offense(<<-RUBY)
expect_offense(<<~RUBY)
RSpec.describe Foo do
it do
expect { subject }.to change { Foo.count }
Expand All @@ -26,7 +26,7 @@
end

it 'registers an offense when nested blocks' do
expect_offense(<<-RUBY)
expect_offense(<<~RUBY)
RSpec.describe Foo do
it do
expect(subject.a).to eq(3)
Expand All @@ -40,7 +40,7 @@
end

it 'registers an offense when custom subjects' do
expect_offense(<<-RUBY)
expect_offense(<<~RUBY)
RSpec.describe Foo do
subject(:bar) { do_something }
Expand Down Expand Up @@ -76,7 +76,7 @@
end

it 'does not register an offense when different subjects' do
expect_no_offenses(<<-RUBY)
expect_no_offenses(<<~RUBY)
RSpec.describe Foo do
subject { do_something_else }
subject(:bar) { do_something }
Expand All @@ -90,7 +90,7 @@
end

it 'does not register an offense when multiple no description it blocks' do
expect_no_offenses(<<-RUBY)
expect_no_offenses(<<~RUBY)
RSpec.describe Foo do
it do
expect { subject }.to change { Foo.count }
Expand Down

0 comments on commit 7ff7552

Please sign in to comment.