Skip to content

Commit d4ec64b

Browse files
committed
Add test for whitespace-only lines
1 parent 8dd7db6 commit d4ec64b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec/unit/puppet-lint/plugins/check_whitespace/trailing_whitespace_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,17 @@
105105
expect(manifest).to eq(fixed)
106106
end
107107
end
108+
109+
context 'empty line with nothing but whitespace' do
110+
let(:code) { " \n " }
111+
112+
it 'only detects a single problem' do
113+
expect(problems).to have(2).problem
114+
end
115+
116+
it 'fixes the manifest' do
117+
expect(manifest).to eq("\n")
118+
end
119+
end
108120
end
109121
end

0 commit comments

Comments
 (0)