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 current_page.save_and_open
end end
def within(selector, &block) def method_missing(name, *args, &block)
current_page.within(selector, &block)
end
def method_missing(name, *args)
if current_page.respond_to?(name) if current_page.respond_to?(name)
current_page.send(name, *args) current_page.send(name, *args, &block)
else else
super super
end end

View File

@ -18,14 +18,10 @@ module ActionController
def respond_to?(name) def respond_to?(name)
super || webrat_session.respond_to?(name) super || webrat_session.respond_to?(name)
end 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) if webrat_session.respond_to?(name)
webrat_session.send(name, *args) webrat_session.send(name, *args, &block)
else else
super super
end end