Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blocks defined amid larger expressions will return the entire line #23

Open
searls opened this issue Jul 20, 2013 · 0 comments
Open

Blocks defined amid larger expressions will return the entire line #23

searls opened this issue Jul 20, 2013 · 0 comments

Comments

@searls
Copy link

searls commented Jul 20, 2013

Given a line like this:

Then { expect(:foo).to eqish arg_that {|arg| arg.kind_of?(String) } }

Asking the block passed to arg_that its source will return a string of the entire line, not only what was passed to the block.

I imagine this is just a limitation of what #source_location tells you (e.g. no column information). Is there any other way to get at this? Would an AST approach perhaps work?

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

No branches or pull requests

1 participant