Permalink
Browse files

Require mocha before the testcase overrides, otherwise its run method…

… is clobbered
  • Loading branch information...
1 parent bedea33 commit a1ce4008c82f8aabcabaad1e424487f56d6ce2a3 @jeremy jeremy committed Nov 19, 2008
Showing with 6 additions and 18 deletions.
  1. +6 −18 activemodel/test/test_helper.rb
@@ -1,30 +1,18 @@
+require 'rubygems'
require 'test/unit'
+
+gem 'mocha', '>= 0.5.5'
+require 'mocha'
+
require 'active_model'
require 'active_model/state_machine'
require 'active_support/test_case'
-def uses_gem(gem_name, test_name, version = '> 0')
- require 'rubygems'
- gem gem_name.to_s, version
- require gem_name.to_s
- yield
-rescue LoadError
- $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again."
-end
-
-# Wrap tests that use Mocha and skip if unavailable.
-unless defined? uses_mocha
- def uses_mocha(test_name, &block)
- uses_gem('mocha', test_name, '>= 0.5.5', &block)
- end
+class ActiveModel::TestCase < ActiveSupport::TestCase
end
begin
- require 'rubygems'
require 'ruby-debug'
Debugger.start
rescue LoadError
end
-
-class ActiveModel::TestCase < ActiveSupport::TestCase
-end

0 comments on commit a1ce400

Please sign in to comment.