Skip to content

Commit

Permalink
Reflect PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
bcgraham committed Jul 13, 2021
1 parent 871a88e commit 22ef074
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions spec/indent_spec.rb
Expand Up @@ -102,7 +102,7 @@ def number
expect(@indent.indent(input)).to eq output
end

it 'should properly indent nested code with consecutive linebreaks' do
it 'returns self when given already-indented code' do
input = <<TXT.strip
class C
def foo
Expand All @@ -115,21 +115,11 @@ def bar
end
TXT

# rubocop:disable Layout/TrailingWhitespace
output = <<TXT.strip
class C
def foo
:foo
end
def bar
:bar
end
end
TXT
# rubocop:enable Layout/TrailingWhitespace
output = input.lines.to_a
output[4] = ' ' + output[4]
output = output.join

expect(@indent.indent(input).inspect).to eq output.inspect
expect(@indent.indent(input)).to eq output
end

it 'should indent statements such as if, else, etc' do
Expand Down

0 comments on commit 22ef074

Please sign in to comment.