Sha256: 33f47ea38e2f115f2a4fd8cfeddc9a38516e59661e7a69a11ef0a97fa9425584

Contents?: true

Size: 443 Bytes

Versions: 120

Compression:

Stored size: 443 Bytes

Contents

module Daddy
  module Cucumber
    module Pause
      
      def pause(second = nil)
        duration = (second || ENV['PAUSE'] || 1).to_i 
        sleep(duration) if duration > 0
      end
      
      def wait_until
        pause_count = 10
        while pause_count > 0 do
          return true if yield
          pause 1
          pause_count -= 1
        end

        false
      end
    
    end
  end
end

World(Daddy::Cucumber::Pause)

Version data entries

120 entries across 120 versions & 1 rubygems

Version Path
daddy-0.5.23 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.22 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.21 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.20 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.19 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.18 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.17 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.16 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.15 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.14 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.13 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.12 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.11 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.10 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.9 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.8 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.7 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.6 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.5 lib/daddy/cucumber/helpers/pause.rb
daddy-0.5.4 lib/daddy/cucumber/helpers/pause.rb