summaryrefslogtreecommitdiff
path: root/spec/rubocop
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 03:08:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-05-26 03:08:02 +0000
commit76784ebd4ac1aa8469c8ea42a5086debeb3102bb (patch)
treeb2d0596568f2cb44f5ec9fdb653f4e7d568cf98f /spec/rubocop
parent3174adc79907c808088a4ede8b891facb9142025 (diff)
downloadgitlab-ce-76784ebd4ac1aa8469c8ea42a5086debeb3102bb.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/rubocop')
-rw-r--r--spec/rubocop/cop/inject_enterprise_edition_module_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/rubocop/cop/inject_enterprise_edition_module_spec.rb b/spec/rubocop/cop/inject_enterprise_edition_module_spec.rb
index 3cb1dbbbc2c..f047baa3bc2 100644
--- a/spec/rubocop/cop/inject_enterprise_edition_module_spec.rb
+++ b/spec/rubocop/cop/inject_enterprise_edition_module_spec.rb
@@ -170,6 +170,20 @@ describe RuboCop::Cop::InjectEnterpriseEditionModule do
SOURCE
end
+ it 'does not flag the use of `prepend_if_ee EE` as long as all injections are at the end of the file' do
+ expect_no_offenses(<<~SOURCE)
+ class Foo
+ end
+
+ Foo.include_if_ee('EE::Foo')
+ Foo.prepend_if_ee('EE::Foo')
+
+ Foo.include(Bar)
+ # comment on prepending Bar
+ Foo.prepend(Bar)
+ SOURCE
+ end
+
it 'autocorrects offenses by just disabling the Cop' do
source = <<~SOURCE
class Foo