File: bug_raise_on_callback.rb

package info (click to toggle)
ruby-curb 1.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 860 kB
  • sloc: ansic: 5,798; ruby: 4,466; makefile: 4
file content (29 lines) | stat: -rw-r--r-- 633 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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