Skip to content

Commit

Permalink
fixup! Update RuboCop empty lines layout config
Browse files Browse the repository at this point in the history
  • Loading branch information
gbp committed Nov 21, 2023
1 parent 8870699 commit 6554f9e
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
require 'rubocop/rspec/support'
require Rails.root.join('lib/custom_cops/empty_lines_around_rescued_exceptions')

RSpec.describe CustomCops::EmptyLinesAroundRescuedExceptions do
RSpec.describe CustomCops::EmptyLinesAroundRescuedExceptions, :config do
include RuboCop::RSpec::ExpectOffense

subject(:cop) { described_class.new }

it 'registers no offense when rescue body is just a single line', :config do
it 'registers no offense when rescue body is just a single line' do
expect_no_offenses(<<~RUBY)
begin
do_something
Expand All @@ -20,7 +18,7 @@
RUBY
end

it 'registers no offense when resbody body is just a single line', :config do
it 'registers no offense when resbody body is just a single line' do
expect_no_offenses(<<~RUBY)
begin
do_something
Expand All @@ -31,7 +29,7 @@
RUBY
end

it 'registers an offense for missing extra newlines before rescued exceptions', :config do
it 'registers an offense for missing extra newlines before rescued exceptions' do
expect_offense(<<~RUBY)
begin
do_something
Expand All @@ -55,7 +53,7 @@
RUBY
end

it 'registers an offense for newlines after rescued exceptions', :config do
it 'registers an offense for newlines after rescued exceptions' do
expect_offense(<<~RUBY)
begin
do_something
Expand Down

0 comments on commit 6554f9e

Please sign in to comment.