one more test for delegation and method_missing proxies

This commit is contained in:
Konstantin Haase 2011-04-17 10:19:49 +02:00
parent 53b5ccde48
commit 1d64be6471
1 changed files with 18 additions and 0 deletions

View File

@ -163,6 +163,24 @@ class DelegatorTest < Test::Unit::TestCase
assert_raises(ArgumentError) { delegate { options }}
end
it "should not swallow any NameErrors" do
mixin = Module.new do
def method_missing(method, *args, &block)
return super unless method.to_sym == :options
foobar
end
end
app = mirror
def app.options(arg) "yay" end
assert_raises NameError do
delegate do
extend mixin
options
end
end
end
delegates 'get'
delegates 'patch'
delegates 'put'