aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-10-26 02:21:21 +0000
committerMichael Koziarski <michael@koziarski.com>2007-10-26 02:21:21 +0000
commit2cc0cac3efce92bf9d0e8636f2889c37ca9f57ab (patch)
tree3ad613f6c73cd9fef243f7586dfcf3b6f329105b /activesupport
parent2bfd6772a4f3f9e0ff395cfd415dafbc1c9dec80 (diff)
downloadrails-2cc0cac3efce92bf9d0e8636f2889c37ca9f57ab.tar.gz
rails-2cc0cac3efce92bf9d0e8636f2889c37ca9f57ab.tar.bz2
rails-2cc0cac3efce92bf9d0e8636f2889c37ca9f57ab.zip
Introduce TestCase subclasses for testing rails applications allowing tests to be DRY'd up a bit and to provide a path toward tidying up our monkeypatching of test/unit.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8022 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/CHANGELOG5
-rw-r--r--activesupport/lib/active_support.rb2
-rw-r--r--activesupport/lib/active_support/test_case.rb5
-rw-r--r--activesupport/lib/active_support/testing.rb1
-rw-r--r--activesupport/lib/active_support/testing/default.rb11
5 files changed, 24 insertions, 0 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG
index a513cd570b..3b05196e68 100644
--- a/activesupport/CHANGELOG
+++ b/activesupport/CHANGELOG
@@ -1,5 +1,10 @@
*SVN*
+* Introduce a base class for all test cases used by rails applications. ActiveSupport::TestCase [Koz]
+
+ The intention is to use this to reduce the amount of monkeypatching / overriding that
+ is done to test/unit's classes.
+
* Document Enumerable and Hash #to_json. #9970 [Chu Yeow]
* Hash#to_xml handles symbol values. #9954 [Assaf]
diff --git a/activesupport/lib/active_support.rb b/activesupport/lib/active_support.rb
index e33f6ceb27..0b3816ec01 100644
--- a/activesupport/lib/active_support.rb
+++ b/activesupport/lib/active_support.rb
@@ -45,3 +45,5 @@ require 'active_support/json'
require 'active_support/multibyte'
+require 'active_support/testing'
+
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb
new file mode 100644
index 0000000000..be8f8b17fc
--- /dev/null
+++ b/activesupport/lib/active_support/test_case.rb
@@ -0,0 +1,5 @@
+module ActiveSupport
+ class TestCase < Test::Unit::TestCase
+ include ActiveSupport::Testing::Default
+ end
+end \ No newline at end of file
diff --git a/activesupport/lib/active_support/testing.rb b/activesupport/lib/active_support/testing.rb
new file mode 100644
index 0000000000..1bf30cbbdd
--- /dev/null
+++ b/activesupport/lib/active_support/testing.rb
@@ -0,0 +1 @@
+require 'active_support/testing/default' \ No newline at end of file
diff --git a/activesupport/lib/active_support/testing/default.rb b/activesupport/lib/active_support/testing/default.rb
new file mode 100644
index 0000000000..0cb0eea7d2
--- /dev/null
+++ b/activesupport/lib/active_support/testing/default.rb
@@ -0,0 +1,11 @@
+module ActiveSupport
+ module Testing
+ module Default
+ def run(*args)
+ return if method_name == :default_test
+ super
+ end
+ end
+ end
+end
+