summaryrefslogtreecommitdiff
path: root/spec/rubocop
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 18:06:11 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 18:06:11 +0000
commit25521def84a6987fe9d4265b560e930bfb32c195 (patch)
tree711e001ea65f76a9c2eb034c4531bda325af84f3 /spec/rubocop
parent9a1c5456747a7b5b218b8b44e4b43396bf7fd705 (diff)
downloadgitlab-ce-25521def84a6987fe9d4265b560e930bfb32c195.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/rubocop')
-rw-r--r--spec/rubocop/cop/line_break_around_conditional_block_spec.rb13
1 files changed, 13 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 892b393c307..cc933ce12c8 100644
--- a/spec/rubocop/cop/line_break_around_conditional_block_spec.rb
+++ b/spec/rubocop/cop/line_break_around_conditional_block_spec.rb
@@ -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|