use #super from #method_missing instead of method aliasing
This commit is contained in:
parent
533ee9c16c
commit
92a9982988
@ -246,7 +246,6 @@ module Rscons
|
||||
end
|
||||
end
|
||||
|
||||
alias_method :orig_method_missing, :method_missing
|
||||
def method_missing(method, *args)
|
||||
if @builders.has_key?(method.to_s)
|
||||
target, source, vars, *rest = args
|
||||
@ -261,7 +260,7 @@ module Rscons
|
||||
args: rest,
|
||||
}
|
||||
else
|
||||
orig_method_missing(method, *args)
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -249,8 +249,7 @@ module Rscons
|
||||
describe "#method_missing" do
|
||||
it "calls the original method missing when the target method is not a known builder" do
|
||||
env = Environment.new
|
||||
env.should_receive(:orig_method_missing).with(:foobar)
|
||||
env.foobar
|
||||
expect {env.foobar}.to raise_error /undefined method .foobar./
|
||||
end
|
||||
|
||||
it "records the target when the target method is a known builder" do
|
||||
|
Loading…
x
Reference in New Issue
Block a user