Skip to content
This repository has been archived by the owner on Jan 10, 2019. It is now read-only.

page's method_missing doesn't forward code blocks #2

Open
citizenmatt opened this issue Oct 22, 2010 · 1 comment
Open

page's method_missing doesn't forward code blocks #2

citizenmatt opened this issue Oct 22, 2010 · 1 comment

Comments

@citizenmatt
Copy link

Pretty much what the title says. The Page class's implementation of method_missing doesn't forward the code block. This stops Capybara's "within" method from working. It looks like this can easily be fixed by adding it to the list of parameters, and passing it in the send method:

def method_missing name, *args, &block
  method_name = name.to_sym
  return super unless browser.respond_to?(method_name)
  browser.send(method_name, *args, &block)
end

This works in a simple trial, but I haven't checked anything else.

(Nice framework, btw)

Thanks
Matt

@impurist
Copy link

Nice pickup Matt.
The dynamic proxy code went in from a suggestion but we haven't really had anything driving it's evolution. We are starting work on a new project which should help this.
When we have the time we will write some tests around this and try to get it in soon.
Of course you you can always fork fix and send us a pull request :)

Thanks for the nice words.
Cheers
Steven

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants