class Test::Unit::TestTestCase::TestStartupShutdown::TestError

Public Class Methods

called() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1177
def called
  @called
end
shutdown() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1144
def shutdown
  raise "from shutdown"
end
startup() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1112
def startup
  raise "from startup"
end

Public Instance Methods

error_count(test_case) click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1105
def error_count(test_case)
  run_test_case(test_case).error_count
end
run_test_case(test_case) click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1098
def run_test_case(test_case)
  test_suite = test_case.suite
  result = TestResult.new
  test_suite.run(result) {}
  result
end
test_error() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1190
def test_error
  raise Interrupt, "from test"
end
test_nothing() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1117
def test_nothing
end
test_on_shutdown() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1141
def test_on_shutdown
  test_case = Class.new(TestCase) do
    class << self
      def shutdown
        raise "from shutdown"
      end
    end

    def test_nothing
    end
  end

  assert_equal(1, error_count(test_case))
end
test_on_startup() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1109
def test_on_startup
  test_case = Class.new(TestCase) do
    class << self
      def startup
        raise "from startup"
      end
    end

    def test_nothing
    end
  end

  assert_equal(1, error_count(test_case))
end
test_pass_through_in_test() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1173
def test_pass_through_in_test
  test_case = Class.new(TestCase) do
    @called = []
    class << self
      def called
        @called
      end

      def startup
        @called << :startup
      end

      def shutdown
        @called << :shutdown
      end
    end

    def test_error
      raise Interrupt, "from test"
    end
  end

  assert_raise(Interrupt) do
    run_test_case(test_case)
  end
  assert_equal([:startup, :shutdown],
               test_case.called)
end
test_pass_through_on_shutdown() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1156
def test_pass_through_on_shutdown
  test_case = Class.new(TestCase) do
    class << self
      def shutdown
        raise Interrupt, "from shutdown"
      end
    end

    def test_nothing
    end
  end

  assert_raise(Interrupt) do
    run_test_case(test_case)
  end
end
test_pass_through_on_startup() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 1124
def test_pass_through_on_startup
  test_case = Class.new(TestCase) do
    class << self
      def startup
        raise Interrupt, "from startup"
      end
    end

    def test_nothing
    end
  end

  assert_raise(Interrupt) do
    run_test_case(test_case)
  end
end