Sha256: 75a4ba9ec1f754fa47313f540de25ecaedffb20c984f069bd6fb701a15511777

Contents?: true

Size: 633 Bytes

Versions: 3

Compression:

Stored size: 633 Bytes

Contents

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

class BugRaiseOnCallback < Test::Unit::TestCase
  include BugTestServerSetupTeardown

  def setup
    @port = 9999
    super
  end

  def test_on_complte
    c = Curl::Easy.new('http://127.0.0.1:9999/test')
    did_raise = false
    begin
      c.on_complete do|x|
        assert_equal 'http://127.0.0.1:9999/test', x.url
        raise "error complete" # this will get swallowed
      end
      c.perform
    rescue => e
      did_raise = true
    end
    assert did_raise, "we want to raise an exception if the ruby callbacks raise"

  end

end

#test_on_debug

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
curb-1.0.6 tests/bug_raise_on_callback.rb
curb-1.0.5 tests/bug_raise_on_callback.rb
curb-1.0.4 tests/bug_raise_on_callback.rb