Skip to content

Commit

Permalink
Pass block args via method_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Jul 26, 2008
1 parent 592f709 commit 88a9a4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions lib/webrat/core/session.rb
Expand Up @@ -44,13 +44,9 @@ def save_and_open_page
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
Expand Down
8 changes: 2 additions & 6 deletions lib/webrat/rails/session.rb
Expand Up @@ -18,14 +18,10 @@ def visits(*args)
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
Expand Down

0 comments on commit 88a9a4c

Please sign in to comment.