Pass block args via method_missing

This commit is contained in:
Bryan Helmkamp 2008-07-26 12:19:27 -04:00
parent 592f70950d
commit 88a9a4cd61
2 changed files with 4 additions and 12 deletions

View File

@ -44,13 +44,9 @@ module Webrat
current_page.save_and_open
end
def within(selector, &block)
current_page.within(selector, &block)
end
def method_missing(name, *args)
def method_missing(name, *args, &block)
if current_page.respond_to?(name)
current_page.send(name, *args)
current_page.send(name, *args, &block)
else
super
end

View File

@ -19,13 +19,9 @@ module ActionController
super || webrat_session.respond_to?(name)
end
def within(selector, &block)
webrat_session.within(selector, &block)
end
def method_missing(name, *args)
def method_missing(name, *args, &block)
if webrat_session.respond_to?(name)
webrat_session.send(name, *args)
webrat_session.send(name, *args, &block)
else
super
end