Skip to content
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.

allow .to in specs to be on next line #16

Open
catmando opened this issue May 22, 2018 · 0 comments
Open

allow .to in specs to be on next line #16

catmando opened this issue May 22, 2018 · 0 comments

Comments

@catmando
Copy link
Contributor

expect_evaluate_ruby { 12 + 12 }
.to eq(24)

does not work.

its because when we get the source code for the block it will include any expressions on the same line. So if you say expect_evaluate_ruby { 12 + 12 }.to eq(24) the tree includes the send(:to) part of the tree.

The solution is to repeatedly do .children.first until we find the block.

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

1 participant