Skip to content

Commit 8cda607

Browse files
committed
100% test coverage.
1 parent 487c15d commit 8cda607

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/rubocop/socketry/cop/layout/consistent_blank_line_indentation.rb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,4 +339,25 @@
339339
expect(offenses.first.message).to be(:include?, RuboCop::Cop::Layout::ConsistentBlankLineIndentation::MESSAGE)
340340
end
341341
end
342+
343+
with "spaces indentation" do
344+
let(:config) do
345+
RuboCop::Config.new(
346+
'Layout/ConsistentBlankLineIndentation' => {
347+
'IndentationWidth' => 2,
348+
'IndentationStyle' => 'space'
349+
}
350+
)
351+
end
352+
353+
let(:source) { "def foo\n puts 'bar'\n \n puts 'baz'\nend\n" }
354+
355+
it "handles spaces indentation correctly" do
356+
processed_source = RuboCop::ProcessedSource.new(source, RUBY_VERSION.to_f)
357+
investigator = RuboCop::Cop::Commissioner.new([cop], [], raise_error: true)
358+
report = investigator.investigate(processed_source)
359+
offenses = report.offenses
360+
expect(offenses.length).to be == 0
361+
end
362+
end
342363
end

0 commit comments

Comments
 (0)