Sha256: 2079c093a527d61c39564b154438533bb6f05d04696fbcab5ef418223abcab16

Contents?: true

Size: 406 Bytes

Versions: 55

Compression:

Stored size: 406 Bytes

Contents

require 'test_helper'
require 'tins'

module Tins
  class LimitedTest < Test::Unit::TestCase
    def test_limited
      count = {}
      limited = Tins::Limited.new(5)
      5.times do
        limited.execute do
          count[Thread.current] = true
          sleep
        end
      end
      until count.size >= 5
        sleep 0.1
      end
      assert_equal 5, count.keys.uniq.size
    end
  end
end

Version data entries

55 entries across 52 versions & 4 rubygems

Version Path
tins-1.17.0 tests/limited_test.rb
tdiary-5.0.9 vendor/bundle/gems/tins-1.16.3/tests/limited_test.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/tins-1.16.3/tests/limited_test.rb
tdiary-5.0.7 vendor/bundle/gems/tins-1.16.3/tests/limited_test.rb
tins-1.16.3 tests/limited_test.rb
tins-1.16.2 tests/limited_test.rb
tins-1.16.1 tests/limited_test.rb
tins-1.16.0 tests/limited_test.rb
tins-1.15.1 tests/limited_test.rb
tdiary-5.0.6 vendor/bundle/gems/tins-1.15.0/tests/limited_test.rb
tins-1.15.0 tests/limited_test.rb
tdiary-5.0.5 vendor/bundle/gems/tins-1.13.2/tests/limited_test.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/tins-1.13.2/tests/limited_test.rb
tdiary-5.0.5 vendor/bundle/gems/tins-1.14.0/tests/limited_test.rb
tins-1.14.0 tests/limited_test.rb
tins-1.13.3 tests/limited_test.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/tins-1.13.2/tests/limited_test.rb
tdiary-5.0.4 vendor/bundle/gems/tins-1.13.2/tests/limited_test.rb
tins-1.13.2 tests/limited_test.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/tins-1.13.0/tests/limited_test.rb