diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/lib/test/unit/testsuite.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/lib/test/unit/testsuite.rb')
-rw-r--r-- | trunk/lib/test/unit/testsuite.rb | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/trunk/lib/test/unit/testsuite.rb b/trunk/lib/test/unit/testsuite.rb deleted file mode 100644 index 6fea976c50..0000000000 --- a/trunk/lib/test/unit/testsuite.rb +++ /dev/null @@ -1,76 +0,0 @@ -#-- -# -# Author:: Nathaniel Talbott. -# Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved. -# License:: Ruby license. - -module Test - module Unit - - # A collection of tests which can be #run. - # - # Note: It is easy to confuse a TestSuite instance with - # something that has a static suite method; I know because _I_ - # have trouble keeping them straight. Think of something that - # has a suite method as simply providing a way to get a - # meaningful TestSuite instance. - class TestSuite - attr_reader :name, :tests - - STARTED = name + "::STARTED" - FINISHED = name + "::FINISHED" - - # Creates a new TestSuite with the given name. - def initialize(name="Unnamed TestSuite") - @name = name - @tests = [] - end - - # Runs the tests and/or suites contained in this - # TestSuite. - def run(result, &progress_block) - yield(STARTED, name) - @tests.each do |test| - test.run(result, &progress_block) - end - yield(FINISHED, name) - end - - # Adds the test to the suite. - def <<(test) - @tests << test - self - end - - def delete(test) - @tests.delete(test) - end - - # Retuns the rolled up number of tests in this suite; - # i.e. if the suite contains other suites, it counts the - # tests within those suites, not the suites themselves. - def size - total_size = 0 - @tests.each { |test| total_size += test.size } - total_size - end - - def empty? - tests.empty? - end - - # Overridden to return the name given the suite at - # creation. - def to_s - @name - end - - # It's handy to be able to compare TestSuite instances. - def ==(other) - return false unless(other.kind_of?(self.class)) - return false unless(@name == other.name) - @tests == other.tests - end - end - end -end |