Class: Capybara::Helpers::Timer Private
- Inherits:
-
Object
- Object
- Capybara::Helpers::Timer
- Defined in:
- lib/capybara/helpers.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #expired? ⇒ Boolean private
-
#initialize(expire_in) ⇒ Timer
constructor
private
A new instance of Timer.
- #stalled? ⇒ Boolean private
Constructor Details
#initialize(expire_in) ⇒ Timer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Timer.
84 85 86 87 |
# File 'lib/capybara/helpers.rb', line 84 def initialize(expire_in) @start = current @expire_in = expire_in end |
Instance Method Details
#expired? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
89 90 91 92 93 |
# File 'lib/capybara/helpers.rb', line 89 def expired? raise Capybara::FrozenInTime, 'Time appears to be frozen. Capybara does not work with libraries which freeze time, consider using time travelling instead' if stalled? current - @start >= @expire_in end |
#stalled? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
95 96 97 |
# File 'lib/capybara/helpers.rb', line 95 def stalled? @start == current end |