Skip to content

Commit

Permalink
Merge pull request #86 from nwoythal/fix-first-token-whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
chelnak authored Feb 24, 2023
2 parents d1cdc01 + a9e7c21 commit b56672d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def fix(problem)

prev_token = problem[:token].prev_token
next_token = problem[:token].next_token
prev_token.next_token = next_token
prev_token.next_token = next_token unless prev_token.nil?
next_token.prev_token = prev_token unless next_token.nil?
tokens.delete(problem[:token])
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,17 @@
expect(manifest).to eq(fixed)
end
end

context 'empty lines with nothing but whitespace' do
let(:code) { " \n " }

it 'detects problems with both empty lines' do
expect(problems).to have(2).problem
end

it 'fixes the manifest' do
expect(manifest).to eq("\n")
end
end
end
end

0 comments on commit b56672d

Please sign in to comment.