Commit 1a46d2f3 authored by Aleksei Lipniagov's avatar Aleksei Lipniagov

Add new example, failing on the old code

parent f3ddb255
......@@ -132,6 +132,19 @@ describe RuboCop::Cop::LineBreakAroundConditionalBlock do
expect(cop.offenses).to be_empty
end
it "doesn't flag violation for #{conditional} preceded by a block definition with a comment" do
source = <<~RUBY
on_block(param_a) do |item| # a short comment
#{conditional} condition
do_something
end
end
RUBY
inspect_source(source)
expect(cop.offenses).to be_empty
end
it "doesn't flag violation for #{conditional} preceded by a block definition using brackets" do
source = <<~RUBY
on_block(param_a) { |item|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment