Sha256: dfcda407dd6b2d219063040dd8372ddab0215798c00b408b4f0d4cad716e404e
Contents?: true
Size: 492 Bytes
Versions: 10
Compression:
Stored size: 492 Bytes
Contents
module Capybara class << self ## # Provides timeout similar to standard library Timeout, but avoids threads # def timeout(seconds = 1, driver = nil, &block) start_time = Time.now result = nil until result return result if result = yield delay = seconds - (Time.now - start_time) if delay <= 0 raise TimeoutError end driver && driver.wait_until(delay) sleep(0.05) end end end end
Version data entries
10 entries across 10 versions & 4 rubygems