mojotech / capybara-ui

Roles and page objects for Capybara integration testing - Formerly called Dill

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eventually does not work with RSpec expect statements

adsteel opened this issue · comments

eventually(40) { expect(roles.user).to see :list_item }

The issue is that when the expectation fails, it throws RSpec::Expectations::ExpectationNotMetError, which subclasses Exception, not StandardError. Eventually only catches StandardError. This means the code above waits only as long as the Capybara wait time (defined in Dill's see?), not the 40 seconds that have been given the eventually

Here's the PR that changed the subclass.
rspec/rspec-expectations#426

Resolved with #107