Pass block args via method_missing
This commit is contained in:
parent
592f70950d
commit
88a9a4cd61
@ -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
|
||||
|
@ -18,14 +18,10 @@ module ActionController
|
||||
def respond_to?(name)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user