summaryrefslogtreecommitdiff
path: root/lib/test/unit
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-19 17:36:03 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-19 17:36:03 +0000
commitb8ef79884b8cc592a46b21ac47da803bfab8a107 (patch)
tree128fe2d8639daa9a453ff1b333db563bfcd7a2b0 /lib/test/unit
parent2572a9bf835455b3b4200d0cd720f705e3fdd187 (diff)
* lib/test/: [DOC] Document Test::Unit, hide most submodules and
classes from rdoc. Since lib/test is only present as a compatibility layer with the legacy test suite many test/unit users will be using minitest or the test/unit gem instead. It is recommended to use one of these alternatives for writing new tests. This patch was based on a patch submitted by Steve Klabnik. [ruby-core:56694] [Bug #8778] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test/unit')
-rw-r--r--lib/test/unit/assertions.rb2
-rw-r--r--lib/test/unit/parallel.rb20
-rw-r--r--lib/test/unit/testcase.rb2
3 files changed, 13 insertions, 11 deletions
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
index bc8530e3f6..3d8a698b0d 100644
--- a/lib/test/unit/assertions.rb
+++ b/lib/test/unit/assertions.rb
@@ -358,7 +358,7 @@ EOT
template.gsub(/\G((?:[^\\]|\\.)*?)(\\)?\?/) { $1 + ($2 ? "?" : mu_pp(arguments.shift)) }
end
- def message(msg = nil, *args, &default)
+ def message(msg = nil, *args, &default) # :nodoc:
if Proc === msg
super(nil, *args) do
[msg.call, (default.call if default)].compact.reject(&:empty?).join(".\n")
diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb
index d1891838f7..c1ecf29263 100644
--- a/lib/test/unit/parallel.rb
+++ b/lib/test/unit/parallel.rb
@@ -2,7 +2,7 @@ require 'test/unit'
module Test
module Unit
- class Worker < Runner
+ class Worker < Runner # :nodoc:
class << self
undef autorun
end
@@ -12,19 +12,19 @@ module Test
undef _run_suites
undef run
- def increment_io(orig)
+ def increment_io(orig) # :nodoc:
*rest, io = 32.times.inject([orig.dup]){|ios, | ios << ios.last.dup }
rest.each(&:close)
io
end
- def _run_suites(suites, type)
+ def _run_suites(suites, type) # :nodoc:
suites.map do |suite|
_run_suite(suite, type)
end
end
- def _run_suite(suite, type)
+ def _run_suite(suite, type) # :nodoc:
@partial_report = []
orig_testout = MiniTest::Unit.output
i,o = IO.pipe
@@ -81,7 +81,7 @@ module Test
i.close if i && !i.closed?
end
- def run(args = [])
+ def run(args = []) # :nodoc:
process_args args
@@stop_auto_run = true
@opts = @options.dup
@@ -149,12 +149,12 @@ module Test
end
end
- def _report(res, *args)
+ def _report(res, *args) # :nodoc:
res = "#{res} #{args.pack("m0")}" unless args.empty?
@stdout.puts(res)
end
- def puke(klass, meth, e)
+ def puke(klass, meth, e) # :nodoc:
@partial_report << [klass.name, meth, e.is_a?(MiniTest::Assertion) ? e : ProxyError.new(e)]
super
end
@@ -165,7 +165,7 @@ end
if $0 == __FILE__
module Test
module Unit
- class TestCase < MiniTest::Unit::TestCase
+ class TestCase < MiniTest::Unit::TestCase # :nodoc: all
undef on_parallel_worker?
def on_parallel_worker?
true
@@ -174,7 +174,9 @@ if $0 == __FILE__
end
end
require 'rubygems'
- class Gem::TestCase < MiniTest::Unit::TestCase
+ module Gem # :nodoc:
+ end
+ class Gem::TestCase < MiniTest::Unit::TestCase # :nodoc:
@@project_dir = File.expand_path('../../../..', __FILE__)
end
diff --git a/lib/test/unit/testcase.rb b/lib/test/unit/testcase.rb
index 59637e1234..984f08dd32 100644
--- a/lib/test/unit/testcase.rb
+++ b/lib/test/unit/testcase.rb
@@ -5,7 +5,7 @@ module Test
# remove silly TestCase class
remove_const(:TestCase) if defined?(self::TestCase)
- class TestCase < MiniTest::Unit::TestCase
+ class TestCase < MiniTest::Unit::TestCase # :nodoc: all
include Assertions
def on_parallel_worker?