jnicklas/capybara — pull request #679 by Empact (2012-03-30 19:11:20+00:00)
Title: Move away from exception control flow in synchronize

Thanks to 643 I noticed capybara uses exceptions to manage retry control flow and I thought I'd give a crack at an alternative.

This is a partial solution which runs green and covers #has_selector?, #has_no_selector?, #has_text?, and #has_no_text?. It removes all uses of the ExpectationNotMet exception.

In this branch, synchronize is somewhat more complicated because it handles both the exception-based control flow and the alternative, but I expect that these two would be unified after a bit more work and the ultimate result would be comparable in simplicity.

At the moment I mostly just want to know if you're interested in this path or if you have any feedback.