Sha256: 8040c97cd3951baa33294c7323f49b22949d6d168d74419855d035813c2a6bee

Contents?: true

Size: 480 Bytes

Versions: 1

Compression:

Stored size: 480 Bytes

Contents

require 'rubygems'
require 'test/unit'

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'glutton_ratelimit'

class Test::Unit::TestCase
end

def timed_run ratelimiter, passes = 1
  before_last_invocation = 0
  start_time = Time.now
  ratelimiter.times(passes * ratelimiter.executions + 1) do
    before_last_invocation = Time.now
    yield
  end 
  before_last_invocation - start_time
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glutton_ratelimit-0.2.0 test/helper.rb