mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
b60827ba04
problematic. * lib/runit/assert.rb: fixed a couple of bugs caused by recent refactoring in Test::Unit. * test/testunit/runit/*: added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
49 lines
1.3 KiB
Ruby
49 lines
1.3 KiB
Ruby
# Author:: Masaki Suketa.
|
|
# Adapted by:: Nathaniel Talbott.
|
|
# Copyright:: Copyright (c) Masaki Suketa. All rights reserved.
|
|
# Copyright:: Copyright (c) 2002 Nathaniel Talbott. All rights reserved.
|
|
# License:: Ruby license.
|
|
|
|
require 'rubyunit'
|
|
|
|
module RUNIT
|
|
class TestTestSuite < RUNIT::TestCase
|
|
def setup
|
|
@testsuite = RUNIT::TestSuite.new
|
|
@dummy_test = Class.new(RUNIT::TestCase) do
|
|
def test_foo
|
|
end
|
|
def test_bar
|
|
end
|
|
end
|
|
@dummy_empty_test = Class.new(RUNIT::TestCase){}
|
|
end
|
|
|
|
def test_count_test_cases
|
|
assert_equal(0, @testsuite.count_test_cases)
|
|
|
|
@testsuite.add(@dummy_empty_test.suite)
|
|
assert_equal(0, @testsuite.count_test_cases)
|
|
|
|
@testsuite.add(@dummy_test.suite)
|
|
assert_equal(2, @testsuite.count_test_cases)
|
|
|
|
@testsuite.add(@dummy_test.suite)
|
|
assert_equal(4, @testsuite.count_test_cases)
|
|
|
|
dummytest_foo = @dummy_test.new('test_foo')
|
|
@testsuite.add(dummytest_foo)
|
|
assert_equal(5, @testsuite.count_test_cases)
|
|
end
|
|
|
|
def test_add
|
|
@testsuite.add(@dummy_empty_test.suite)
|
|
assert_equal(0, @testsuite.size)
|
|
assert_equal(0, @testsuite.count_test_cases)
|
|
|
|
@testsuite.add(@dummy_test.suite)
|
|
assert_equal(2, @testsuite.size)
|
|
assert_equal(2, @testsuite.count_test_cases)
|
|
end
|
|
end
|
|
end
|