Commit 517ee9fd authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix Override. Properly define prepended

We should never be sloppy!
parent 71fefe14
...@@ -92,9 +92,13 @@ module Gitlab ...@@ -92,9 +92,13 @@ module Gitlab
queue_verification(base) queue_verification(base)
end end
alias_method :prepended, :included def prepended(base = nil)
super
queue_verification(base)
end
def extended(mod) def extended(mod = nil)
super super
queue_verification(mod.singleton_class) queue_verification(mod.singleton_class)
......
...@@ -23,7 +23,7 @@ describe Gitlab::Patch::Prependable do ...@@ -23,7 +23,7 @@ describe Gitlab::Patch::Prependable do
this = self this = self
prepended do prepended do
prepended_modules_ << this prepended_modules_ << [self, this]
end end
def name def name
...@@ -48,7 +48,7 @@ describe Gitlab::Patch::Prependable do ...@@ -48,7 +48,7 @@ describe Gitlab::Patch::Prependable do
this = self this = self
prepended do prepended do
prepended_modules_ << this prepended_modules_ << [self, this]
end end
def name def name
...@@ -71,7 +71,7 @@ describe Gitlab::Patch::Prependable do ...@@ -71,7 +71,7 @@ describe Gitlab::Patch::Prependable do
subject subject
expect(prepended_modules).to eq([ee, ce]) expect(prepended_modules).to eq([[subject, ee], [subject, ce]])
end end
end end
...@@ -86,7 +86,7 @@ describe Gitlab::Patch::Prependable do ...@@ -86,7 +86,7 @@ describe Gitlab::Patch::Prependable do
it 'prepends only once' do it 'prepends only once' do
subject.prepend(ce) subject.prepend(ce)
expect(prepended_modules).to eq([ee, ce]) expect(prepended_modules).to eq([[subject, ee], [subject, ce]])
end end
end end
...@@ -115,7 +115,7 @@ describe Gitlab::Patch::Prependable do ...@@ -115,7 +115,7 @@ describe Gitlab::Patch::Prependable do
it 'prepends only once' do it 'prepends only once' do
subject.prepend(ee) subject.prepend(ee)
expect(prepended_modules).to eq([ee]) expect(prepended_modules).to eq([[subject, ee]])
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment