Class: Capybara::Helpers::Timer Private
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/capybara/helpers.rb |
Class Attribute Summary
- .expired? ⇒ Boolean readonly Internal use only mod_func
- .stalled? ⇒ Boolean readonly Internal use only mod_func
Class Method Summary
- .initialize(expire_in) Internal use only mod_func
- .current private Internal use only mod_func
- .new(expire_in) constructor private Internal use only Internal use only
Constructor Details
.new(expire_in) (private)
This method is for internal use only.
[ GitHub ]
# File 'lib/capybara/helpers.rb', line 103
def initialize(expire_in) @start = current @expire_in = expire_in end
Class Attribute Details
.expired? ⇒ Boolean
(readonly, mod_func)
# File 'lib/capybara/helpers.rb', line 108
def expired? if stalled? raise Capybara::FrozenInTime, 'Time appears to be frozen. Capybara does not work with libraries which freeze time, consider using time travelling instead' end current - @start >= @expire_in end
.stalled? ⇒ Boolean
(readonly, mod_func)
# File 'lib/capybara/helpers.rb', line 116
def stalled? @start == current end
Class Method Details
.current (private, mod_func)
[ GitHub ]# File 'lib/capybara/helpers.rb', line 122
def current Capybara::Helpers.monotonic_time end
.initialize(expire_in) (mod_func)
[ GitHub ]# File 'lib/capybara/helpers.rb', line 103
def initialize(expire_in) @start = current @expire_in = expire_in end