Module: Capybara::Lockstep::Util

Defined in:
lib/capybara-lockstep/util.rb

Class Method Summary collapse

Class Method Details

.current_secondsObject



15
16
17
# File 'lib/capybara-lockstep/util.rb', line 15

def current_seconds
  Process.clock_gettime(Process::CLOCK_MONOTONIC)
end

.with_max_wait_time(seconds, &block) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/capybara-lockstep/util.rb', line 5

def with_max_wait_time(seconds, &block)
  old_max_wait_time = Capybara.default_max_wait_time
  Capybara.default_max_wait_time = seconds
  begin
    block.call
  ensure
    Capybara.default_max_wait_time = old_max_wait_time
  end
end