Skip to content

Commit

Permalink
Switch rake's tests to minitest
Browse files Browse the repository at this point in the history
  • Loading branch information
drbrain committed May 21, 2011
1 parent 0534fa5 commit 0dba7c9
Show file tree
Hide file tree
Showing 22 changed files with 177 additions and 175 deletions.
4 changes: 3 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'

Expand Down
24 changes: 0 additions & 24 deletions test/capture_stdout.rb

This file was deleted.

27 changes: 17 additions & 10 deletions test/helper.rb
Original file line number Diff line number Diff line change
@@ -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=

Loading

0 comments on commit 0dba7c9

Please sign in to comment.