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.3.33 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.32 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.31 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.30 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.29 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.28 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.27 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.26 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.25 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.24 lib/daddy/cucumber/helpers/pause.rb
daddy-0.3.23 lib/daddy/cucumber/pause.rb
daddy-0.3.22 lib/daddy/cucumber/pause.rb
daddy-0.3.21 lib/daddy/cucumber/pause.rb
daddy-0.3.20 lib/daddy/cucumber/pause.rb
daddy-0.3.19 lib/daddy/cucumber/pause.rb
daddy-0.3.18 lib/daddy/cucumber/pause.rb
daddy-0.3.17 lib/daddy/cucumber/pause.rb
daddy-0.3.16 lib/daddy/cucumber/pause.rb
daddy-0.3.15 lib/daddy/cucumber/pause.rb
daddy-0.3.14 lib/daddy/cucumber/pause.rb