diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-03 21:06:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-03 21:06:11 +0300 |
commit | 25521def84a6987fe9d4265b560e930bfb32c195 (patch) | |
tree | 711e001ea65f76a9c2eb034c4531bda325af84f3 /spec/rubocop | |
parent | 9a1c5456747a7b5b218b8b44e4b43396bf7fd705 (diff) |
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.rb | 13 |
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| |