From b8ef79884b8cc592a46b21ac47da803bfab8a107 Mon Sep 17 00:00:00 2001 From: zzak Date: Mon, 19 Aug 2013 17:36:03 +0000 Subject: * 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 --- lib/test/unit/assertions.rb | 2 +- lib/test/unit/parallel.rb | 20 +++++++++++--------- lib/test/unit/testcase.rb | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'lib/test/unit') 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? -- cgit v1.2.3