Sha256: c19164bf780417793324db55bbd1d81708f0f12bce3b5df658e267a8f39f9c6d
Contents?: true
Size: 676 Bytes
Versions: 43
Compression:
Stored size: 676 Bytes
Contents
require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper')) with_rackup do Shindo.tests do test('threaded requests') do connection = Excon.new('http://127.0.0.1:9292') long_thread = Thread.new { response = connection.request(:method => 'GET', :path => '/id/1/wait/2') Thread.current[:success] = response.body == '1' } short_thread = Thread.new { response = connection.request(:method => 'GET', :path => '/id/2/wait/1') Thread.current[:success] = response.body == '2' } long_thread.join short_thread.join long_thread[:success] && short_thread[:success] end end end
Version data entries
43 entries across 43 versions & 2 rubygems