From 88a9a4cd610b8c9ed430b0b78c6f8250df73584a Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 26 Jul 2008 12:19:27 -0400 Subject: [PATCH] Pass block args via method_missing --- lib/webrat/core/session.rb | 8 ++------ lib/webrat/rails/session.rb | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/webrat/core/session.rb b/lib/webrat/core/session.rb index 49d0ee0..5b5bd63 100644 --- a/lib/webrat/core/session.rb +++ b/lib/webrat/core/session.rb @@ -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 diff --git a/lib/webrat/rails/session.rb b/lib/webrat/rails/session.rb index 0105d7e..4990efd 100644 --- a/lib/webrat/rails/session.rb +++ b/lib/webrat/rails/session.rb @@ -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