~brightbox/brightbox/libeventmachine-ruby

« back to all changes in this revision

Viewing changes to tests/test_exc.rb

  • Committer: Bazaar Package Importer
  • Author(s): Daigo Moriwaki
  • Date: 2010-04-10 12:05:59 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100410120559-v0sa93w19rq16vuf
Tags: 0.12.10-1
* New upstream release. (Closes: #577102)
* debian/control: 
  - Bumped up Standards-Version to 3.8.4.
* debian/watch:
  - The upstream seems to only distribute a gem package, no longer in the
  *.tar.gz format. The watch file watches versions of gem packages.  Thanks
  to Frederic Peters for letting me know.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
class TestSomeExceptions < Test::Unit::TestCase
31
31
 
32
 
 
33
 
    # Read the commentary in EventMachine#run.
34
 
    # This test exercises the ensure block in #run that makes sure
35
 
    # EventMachine#release_machine gets called even if an exception is
36
 
    # thrown within the user code. Without the ensured call to release_machine,
37
 
    # the second call to EventMachine#run will fail with a C++ exception
38
 
    # because the machine wasn't cleaned up properly.
39
 
 
40
 
    def test_a
41
 
        assert_raises(RuntimeError) {
42
 
            EventMachine.run {
43
 
                raise "some exception"
44
 
            }
45
 
        }
46
 
    end
47
 
 
48
 
    def test_b
49
 
        assert_raises(RuntimeError) {
50
 
            EventMachine.run {
51
 
                raise "some exception"
52
 
            }
53
 
        }
54
 
    end
55
 
 
 
32
  # Read the commentary in EventMachine#run.
 
33
  # This test exercises the ensure block in #run that makes sure
 
34
  # EventMachine#release_machine gets called even if an exception is
 
35
  # thrown within the user code. Without the ensured call to release_machine,
 
36
  # the second call to EventMachine#run will fail with a C++ exception
 
37
  # because the machine wasn't cleaned up properly.
 
38
 
 
39
  def test_a
 
40
    assert_raises(RuntimeError) {
 
41
      EventMachine.run {
 
42
      raise "some exception"
 
43
    }
 
44
    }
 
45
  end
 
46
 
 
47
  def test_b
 
48
    assert_raises(RuntimeError) {
 
49
      EventMachine.run {
 
50
      raise "some exception"
 
51
    }
 
52
    }
 
53
  end
56
54
 
57
55
end
58