Permalink
Browse files

Switch rake's tests to minitest

  • Loading branch information...
drbrain committed May 21, 2011
1 parent 0534fa5 commit 0dba7c927dc9de943e68474046489ac432a9954e
View
@@ -63,7 +63,8 @@ task :default => :test
# Test Tasks ---------------------------------------------------------
Rake::TestTask.new do |t|
- t.test_files = FileList['test/test_*.rb']
+ files = FileList['test/helper.rb', 'test/test_*.rb']
+ t.test_files = files
t.libs << "."
t.warning = true
end
@@ -179,6 +180,7 @@ else
#### Dependencies and requirements.
s.required_rubygems_version = '>= 1.3.2'
+ s.add_development_dependency 'minitest', '~> 2.1'
s.add_development_dependency 'session', '~> 2.4'
s.add_development_dependency 'flexmock', '~> 0.8.11'
View
@@ -1,24 +0,0 @@
-require 'stringio'
-
-# Mix-in for capturing standard output.
-module CaptureStdout
- def capture_stdout
- s = StringIO.new
- oldstdout = $stdout
- $stdout = s
- yield
- s.string
- ensure
- $stdout = oldstdout
- end
-
- def capture_stderr
- s = StringIO.new
- oldstderr = $stderr
- $stderr = s
- yield
- s.string
- ensure
- $stderr = oldstderr
- end
-end
View
@@ -1,23 +1,30 @@
require 'rubygems'
-require 'test/unit'
-require 'flexmock/test_unit'
-
-require 'test/capture_stdout'
-require 'test/file_creation'
-
+require 'minitest/unit'
+require 'flexmock/test_unit_integration'
+require 'minitest/autorun'
require 'rake'
-class Rake::TestCase < Test::Unit::TestCase
+class Rake::TestCase < MiniTest::Unit::TestCase
+ include FlexMock::ArgumentTypes
+ include FlexMock::MockContainer
+
include Rake::DSL
+ def teardown
+ flexmock_teardown
+ super
+ end
+
def ignore_deprecations
Rake.application.options.ignore_deprecate = true
yield
ensure
Rake.application.options.ignore_deprecate = false
end
- def assert_exception(ex, msg="", &block)
- assert_raise(ex, msg, &block)
- end
end
+
+# workarounds for 1.8
+$" << 'test/helper.rb'
+Test::Unit.run = true if Test::Unit.respond_to? :run=
+
Oops, something went wrong.

0 comments on commit 0dba7c9

Please sign in to comment.