1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/testunit/runit/test_testsuite.rb
ntalbott b60827ba04 * lib/rubyunit.rb: aliasing TestCase into the top level is
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
2003-10-05 02:17:07 +00:00

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