diff options
-rw-r--r-- | lib/gitlab/utils/override.rb | 8 | ||||
-rw-r--r-- | spec/lib/gitlab/patch/prependable_spec.rb | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/gitlab/utils/override.rb b/lib/gitlab/utils/override.rb index 7b2a62fed48..5be34e6b520 100644 --- a/lib/gitlab/utils/override.rb +++ b/lib/gitlab/utils/override.rb @@ -92,9 +92,13 @@ module Gitlab queue_verification(base) end - alias_method :prepended, :included + def prepended(base = nil) + super + + queue_verification(base) + end - def extended(mod) + def extended(mod = nil) super queue_verification(mod.singleton_class) diff --git a/spec/lib/gitlab/patch/prependable_spec.rb b/spec/lib/gitlab/patch/prependable_spec.rb index 1c90a24c0e8..32222544e46 100644 --- a/spec/lib/gitlab/patch/prependable_spec.rb +++ b/spec/lib/gitlab/patch/prependable_spec.rb @@ -23,7 +23,7 @@ describe Gitlab::Patch::Prependable do this = self prepended do - prepended_modules_ << this + prepended_modules_ << [self, this] end def name @@ -48,7 +48,7 @@ describe Gitlab::Patch::Prependable do this = self prepended do - prepended_modules_ << this + prepended_modules_ << [self, this] end def name @@ -71,7 +71,7 @@ describe Gitlab::Patch::Prependable do subject - expect(prepended_modules).to eq([ee, ce]) + expect(prepended_modules).to eq([[subject, ee], [subject, ce]]) end end @@ -86,7 +86,7 @@ describe Gitlab::Patch::Prependable do it 'prepends only once' do subject.prepend(ce) - expect(prepended_modules).to eq([ee, ce]) + expect(prepended_modules).to eq([[subject, ee], [subject, ce]]) end end @@ -115,7 +115,7 @@ describe Gitlab::Patch::Prependable do it 'prepends only once' do subject.prepend(ee) - expect(prepended_modules).to eq([ee]) + expect(prepended_modules).to eq([[subject, ee]]) end end end |