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
tdiary-5.1.1 vendor/bundle/ruby/2.7.0/gems/tins-1.24.1/tests/limited_test.rb
tins-1.24.1 tests/limited_test.rb
tins-1.24.0 tests/limited_test.rb
tins-1.23.0 tests/limited_test.rb
tdiary-5.1.0 vendor/bundle/gems/tins-1.22.2/tests/limited_test.rb
tins-1.22.2 tests/limited_test.rb
tins-1.22.1 tests/limited_test.rb
tins-1.22.0 tests/limited_test.rb
tins-1.21.1 tests/limited_test.rb
tins-1.21.0 tests/limited_test.rb
tins-1.20.3 tests/limited_test.rb
tdiary-5.0.13 vendor/bundle/gems/tins-1.20.2/tests/limited_test.rb
tdiary-5.0.12.1 vendor/bundle/gems/tins-1.20.2/tests/limited_test.rb
tdiary-5.0.11 vendor/bundle/gems/tins-1.20.2/tests/limited_test.rb
tdiary-5.0.11 vendor/bundle/gems/tins-1.16.3/tests/limited_test.rb
tins-1.20.2 tests/limited_test.rb
tins-1.20.1 tests/limited_test.rb
tins-1.20.0 tests/limited_test.rb
tins-1.19.0 tests/limited_test.rb
tins-1.18.0 tests/limited_test.rb