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.9.9 lib/daddy/cucumber/helpers/pause.rb
daddy-0.9.8 lib/daddy/cucumber/helpers/pause.rb
daddy-0.9.7 lib/daddy/cucumber/helpers/pause.rb
daddy-0.9.6 lib/daddy/cucumber/helpers/pause.rb
daddy-0.9.5 lib/daddy/cucumber/helpers/pause.rb
daddy-0.9.4 lib/daddy/cucumber/helpers/pause.rb
daddy-0.9.3 lib/daddy/cucumber/helpers/pause.rb
daddy-0.9.2 lib/daddy/cucumber/helpers/pause.rb
daddy-0.9.1 lib/daddy/cucumber/helpers/pause.rb
daddy-0.9.0 lib/daddy/cucumber/helpers/pause.rb
daddy-0.8.1 lib/daddy/cucumber/helpers/pause.rb
daddy-0.8.0 lib/daddy/cucumber/helpers/pause.rb
daddy-0.7.9 lib/daddy/cucumber/helpers/pause.rb
daddy-0.7.8 lib/daddy/cucumber/helpers/pause.rb
daddy-0.7.7 lib/daddy/cucumber/helpers/pause.rb
daddy-0.7.6 lib/daddy/cucumber/helpers/pause.rb
daddy-0.7.5 lib/daddy/cucumber/helpers/pause.rb
daddy-0.7.4 lib/daddy/cucumber/helpers/pause.rb
daddy-0.7.3 lib/daddy/cucumber/helpers/pause.rb
daddy-0.7.2 lib/daddy/cucumber/helpers/pause.rb