Sha256: c4f852d6d7f80af04a08dc97f0086ca350ccdc8116403207887d1ac94098d193

Contents?: true

Size: 776 Bytes

Versions: 26

Compression:

Stored size: 776 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))

# This test suite requires the timeout server to be running
# See tests/timeout.rb for more info about the timeout server
class TestCurbSignals < Test::Unit::TestCase

  # Testcase for https://github.com/taf2/curb/issues/117
  def test_continue_after_signal
    trap("SIGUSR1") { }

    curl = Curl::Easy.new(wait_url(2))
    pid = $$
    Thread.new do
      sleep 1
      Process.kill("SIGUSR1", pid)
    end
    assert_equal true, curl.http_get
  end

  private
  
  def wait_url(time)
    "#{server_base}/wait/#{time}"
  end
  
  def serve_url(chunk_size, time, count)
    "#{server_base}/serve/#{chunk_size}/every/#{time}/for/#{count}"
  end
  
  def server_base
    'http://127.0.0.1:9128'
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
curb-1.0.6 tests/signals.rb
curb-1.0.5 tests/signals.rb
curb-1.0.4 tests/signals.rb
curb-1.0.3 tests/signals.rb
curb-1.0.2 tests/signals.rb
curb-1.0.1 tests/signals.rb
curb-1.0.0 tests/signals.rb
curb-0.9.11 tests/signals.rb
curb-0.9.10 tests/signals.rb
curb-0.9.9 tests/signals.rb
curb-0.9.8 tests/signals.rb
curb-0.9.7 tests/signals.rb
curb-0.9.6 tests/signals.rb
curb-0.9.5 tests/signals.rb
curb-0.9.4 tests/signals.rb
curb-0.9.3 tests/signals.rb
curb-0.9.2 tests/signals.rb
curb-0.9.1 tests/signals.rb
curb-0.9.0 tests/signals.rb
curb-0.8.8 tests/signals.rb