aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/testing
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/testing')
-rw-r--r--activesupport/lib/active_support/testing/mocha_module.rb22
-rw-r--r--activesupport/lib/active_support/testing/mochaing.rb7
2 files changed, 22 insertions, 7 deletions
diff --git a/activesupport/lib/active_support/testing/mocha_module.rb b/activesupport/lib/active_support/testing/mocha_module.rb
new file mode 100644
index 0000000000..ed2942d23a
--- /dev/null
+++ b/activesupport/lib/active_support/testing/mocha_module.rb
@@ -0,0 +1,22 @@
+module ActiveSupport
+ module Testing
+ module MochaModule
+ begin
+ require 'mocha_standalone'
+ include Mocha::API
+
+ def before_setup
+ mocha_setup
+ super
+ end
+
+ def after_teardown
+ super
+ mocha_verify
+ mocha_teardown
+ end
+ rescue LoadError
+ end
+ end
+ end
+end
diff --git a/activesupport/lib/active_support/testing/mochaing.rb b/activesupport/lib/active_support/testing/mochaing.rb
deleted file mode 100644
index 4ad75a6681..0000000000
--- a/activesupport/lib/active_support/testing/mochaing.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-begin
- silence_warnings { require 'mocha' }
-rescue LoadError
- # Fake Mocha::ExpectationError so we can rescue it in #run. Bleh.
- Object.const_set :Mocha, Module.new
- Mocha.const_set :ExpectationError, Class.new(StandardError)
-end \ No newline at end of file