File: test_testrunmediator.rb

package info (click to toggle)
ruby-test-unit 2.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 772 kB
  • sloc: ruby: 11,397; makefile: 6
file content (20 lines) | stat: -rw-r--r-- 560 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'test/unit/ui/testrunnermediator'

class TestUnitUIMediator < Test::Unit::TestCase
  def test_run_suite_with_interrupt_exception
    test_case = Class.new(Test::Unit::TestCase) do
      def test_raise_interrupt
        raise Interrupt, "from test"
      end
    end
    mediator = Test::Unit::UI::TestRunnerMediator.new(test_case.suite)
    finished = false
    mediator.add_listener(Test::Unit::UI::TestRunnerMediator::FINISHED) do
      finished = true
    end
    assert_raise(Interrupt) do
      mediator.run
    end
    assert(finished)
  end
end