I think @jarmo raises some valid points. If someone creates a time mocking 
library that also stubs out `sleep` (which is what the `Timeout` module relies 
on), the proposed solution is useless.

Perhaps a compromise would be to make the configuration option more generic by 
letting the user (or a third-party gem) swap out the full timeout 
implementation, maybe something like this:

```ruby
Watir.wait_timer #=> #<Watir::Wait::Timer:0x...>
Watir.wait_timer = MyTimeoutImplementation.new
```

(suggestions for better names are welcome)

It's a probably a bit overkill, but it would solve the problem that a future 
time mocking library makes both `Time` and `Timeout` unusable, and keep it easy 
for all users to employ `when_present` without monkey patching or littering 
their code with `return` or `freeze` equivalents.

---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-webdriver/pull/242#issuecomment-33959846
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development

Reply via email to