diff options
author | Rémy Coutable <remy@rymai.me> | 2018-05-28 15:00:09 +0200 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-05-29 10:38:59 +0200 |
commit | 1c5106fadfe59ec4af7235b94d424e4367185c2e (patch) | |
tree | 1cbbf310f20cb21ebb2b74d200c2333d3d7c1312 /spec/rubocop | |
parent | 2b8eb7273efee84180b322a0aac33e1f4ee30d2c (diff) | |
download | gitlab-ce-1c5106fadfe59ec4af7235b94d424e4367185c2e.tar.gz |
Allow comment after if/unless clause46758-fallout-of-cacheable-attribute
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/rubocop')
-rw-r--r-- | spec/rubocop/cop/line_break_around_conditional_block_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/rubocop/cop/line_break_around_conditional_block_spec.rb b/spec/rubocop/cop/line_break_around_conditional_block_spec.rb index 7ddf9141fcd..03eeffe6483 100644 --- a/spec/rubocop/cop/line_break_around_conditional_block_spec.rb +++ b/spec/rubocop/cop/line_break_around_conditional_block_spec.rb @@ -256,6 +256,18 @@ describe RuboCop::Cop::LineBreakAroundConditionalBlock do expect(cop.offenses).to be_empty end + it "doesn't flag violation for #{conditional} followed by a comment" do + source = <<~RUBY + #{conditional} condition + do_something + end + # a short comment + RUBY + inspect_source(source) + + expect(cop.offenses).to be_empty + end + it "doesn't flag violation for #{conditional} followed by an end" do source = <<~RUBY class Foo |