Commit 2ba00a3e authored by Lin Jen-Shin's avatar Lin Jen-Shin

Fix Override. Properly define prepended

We should never be sloppy!
parent 829e596a
......@@ -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)
......
......@@ -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
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