~ubuntu-branches/ubuntu/utopic/ruby-excon/utopic

« back to all changes in this revision

Viewing changes to tests/thread_safety_tests.rb

  • Committer: Package Import Robot
  • Author(s): Praveen Arimbrathodiyil
  • Date: 2014-01-14 18:44:24 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20140114184424-3nx5mqudhzjpcrjs
Tags: 0.31.0-1
* Team upload
* New upstream release
* Refresh patches
* Bump standards version to 3.9.5 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
with_rackup('thread_safety.ru') do
2
 
  Shindo.tests('Excon thread safety') do
 
1
Shindo.tests('Excon thread safety') do
 
2
  with_rackup('thread_safety.ru') do
3
3
    connection = Excon.new('http://127.0.0.1:9292')
4
4
 
5
5
    long_thread = Thread.new {
12
12
      Thread.current[:success] = response.body == '2'
13
13
    }
14
14
 
15
 
    long_thread.join
16
 
    short_thread.join
17
 
 
18
15
    test('long_thread') do
 
16
      long_thread.join
 
17
      short_thread.join
 
18
 
19
19
      long_thread[:success]
20
20
    end
21
21