summaryrefslogtreecommitdiff
path: root/lib/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-30 14:13:12 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-30 14:13:12 +0000
commit1af1196616195f2283948f4f2f0d8585712f715a (patch)
tree04b292a1eedfb7d8a2dde35e5dc8113f8fd8a92a /lib/test
parent1eeb3e151e40545267087530e07d3062b820d887 (diff)
Reverts the changes of lib/test/unit/* in r19543, r19534 and r19503.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test')
-rw-r--r--lib/test/unit.rb10
-rw-r--r--lib/test/unit/assertions.rb59
-rw-r--r--lib/test/unit/deprecate.rb30
-rw-r--r--lib/test/unit/error.rb17
-rw-r--r--lib/test/unit/testcase.rb31
5 files changed, 0 insertions, 147 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
deleted file mode 100644
index 5988976ce2..0000000000
--- a/lib/test/unit.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-require 'mini/test'
-require 'test/unit/testcase' # pull in deprecated functionality
-
-Mini::Test.autorun
diff --git a/lib/test/unit/assertions.rb b/lib/test/unit/assertions.rb
deleted file mode 100644
index 6c29b78096..0000000000
--- a/lib/test/unit/assertions.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-require 'mini/test'
-require 'test/unit/deprecate'
-
-module Test; end
-module Test::Unit # patch up bastards that that extend improperly.
- if defined? Assertions then
- warn "ARGH! someone defined Test::Unit::Assertions rather than requiring"
- CRAP_ASSERTIONS = Assertions
- remove_const :Assertions
-
- # this will break on junit and rubinius... *sigh*
- ObjectSpace.each_object(Module) do |offender|
- offender.send :include, ::Mini::Assertions if offender < CRAP_ASSERTIONS
- end rescue nil
-
- Test::Unit::TestCase.send :include, CRAP_ASSERTIONS
- end
-
- Assertions = ::Mini::Assertions
-
- module Assertions
- def self.included mod
- mod.send :include, Test::Unit::CRAP_ASSERTIONS
- end if defined? Test::Unit::CRAP_ASSERTIONS
- end
-end
-
-module Test::Unit
- module Assertions # deprecations
- tu_deprecate :assert_nothing_thrown, :assert_nothing_raised # 2009-06-01
- tu_deprecate :assert_raise, :assert_raises # 2010-06-01
- tu_deprecate :assert_not_equal, :refute_equal # 2009-06-01
- tu_deprecate :assert_no_match, :refute_match # 2009-06-01
- tu_deprecate :assert_not_nil, :refute_nil # 2009-06-01
- tu_deprecate :assert_not_same, :refute_same # 2009-06-01
-
- def assert_nothing_raised _ = :ignored # 2009-06-01
- self.class.tu_deprecation_warning :assert_nothing_raised
- self._assertions += 1
- yield
- rescue => e
- raise Mini::Assertion, exception_details(e, "Exception raised:")
- end
-
- def build_message(user_message, template_message, *args) # 2009-06-01
- self.class.tu_deprecation_warning :build_message
- user_message ||= ''
- user_message += ' ' unless user_message.empty?
- msg = template_message.split(/<\?>/).zip(args.map { |o| o.inspect })
- user_message + msg.join
- end
- end
-end
diff --git a/lib/test/unit/deprecate.rb b/lib/test/unit/deprecate.rb
deleted file mode 100644
index 60f0a52d3e..0000000000
--- a/lib/test/unit/deprecate.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-class Module # define deprecation api
- DEPS = Hash.new { |h,k| h[k] = {} }
-
- def tu_deprecation_warning old, new = nil, kaller = nil
- kaller ||= caller[1]
- unless DEPS[old][kaller] then
- msg = "#{self}##{old} deprecated. "
- msg += new ? "Use ##{new}" : "No replacement is provided"
- msg += ". From #{kaller}."
- warn msg
- end
- DEPS[old][kaller] = true
- end
-
- def tu_deprecate old, new
- class_eval <<-EOM
- def #{old} *args, &block
- cls, clr = self.class, caller.first
- self.class.tu_deprecation_warning #{old.inspect}, #{new.inspect}, clr
- #{new}(*args, &block)
- end
- EOM
- end
-end
diff --git a/lib/test/unit/error.rb b/lib/test/unit/error.rb
deleted file mode 100644
index c62fe1af8a..0000000000
--- a/lib/test/unit/error.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-require 'test/unit/deprecate'
-
-# rails currently needs this file and this one method.
-module Test::Unit
- class Error
- def message
- self.class.tu_deprecation_warning :message # 2009-06-01
- "you're a loser"
- end
- end
-end
diff --git a/lib/test/unit/testcase.rb b/lib/test/unit/testcase.rb
deleted file mode 100644
index a0498e52ca..0000000000
--- a/lib/test/unit/testcase.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-############################################################
-# This file is imported from a different project.
-# DO NOT make modifications in this repo.
-# File a patch instead and assign it to Ryan Davis
-############################################################
-
-require 'mini/test'
-require 'test/unit/deprecate'
-
-warn "require 'test/unit/testcase' has been deprecated" unless
- caller.first =~ /test.unit.rb/
-
-module Test; end
-module Test::Unit # was ::Mini::Test, but rails' horrid code forced my hand
- if defined? TestCase then
- warn "ARGH! someone defined Test::Unit::TestCase rather than requiring"
- remove_const :TestCase
- end
-
- AssertionFailedError = ::Mini::Assertion
-
- class TestCase < ::Mini::Test::TestCase
- tu_deprecate :method_name, :name # 2009-06-01
-
- def self.test_order # 2009-06-01
- :sorted
- end
- end
-end
-
-require 'test/unit/assertions' # brings in deprecated methods