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
|
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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user