diff options
Diffstat (limited to 'actionpack/test/abstract_unit.rb')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index de4ca439f4..bc7c80f1ce 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -14,3 +14,13 @@ ActiveSupport::Deprecation.debug = true ActionController::Base.logger = nil ActionController::Base.ignore_missing_templates = false ActionController::Routing::Routes.reload rescue nil + + +# Wrap tests that use Mocha and skip if unavailable. +def uses_mocha(test_name) + require 'mocha' + require 'stubba' + yield +rescue LoadError + $stderr.puts "Skipping #{test_name} tests. `gem install mocha` and try again." +end |