Module: Daddy::Cucumber::Pause

Defined in:
lib/daddy/cucumber/helpers/pause.rb

Instance Method Summary collapse

Instance Method Details

#pause(second = nil) ⇒ Object



5
6
7
8
# File 'lib/daddy/cucumber/helpers/pause.rb', line 5

def pause(second = nil)
  duration = (second || ENV['PAUSE'] || 1).to_i 
  sleep(duration) if duration > 0
end

#wait_untilObject



10
11
12
13
14
15
16
17
18
19
# File 'lib/daddy/cucumber/helpers/pause.rb', line 10

def wait_until
  pause_count = 10
  while pause_count > 0 do
    return true if yield
    pause 1
    pause_count -= 1
  end

  false
end