diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 14:21:53 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 14:28:28 -0700 |
commit | 089da2e54db54c021681af1a31aadc2c0e15c1e0 (patch) | |
tree | 93d6df028dc5633e0e73ab098afe276057352e68 /activesupport/lib/active_support/testing/mocha_module.rb | |
parent | 1337d51f44496d3279f9daf53961777f50b1910d (diff) | |
download | rails-089da2e54db54c021681af1a31aadc2c0e15c1e0.tar.gz rails-089da2e54db54c021681af1a31aadc2c0e15c1e0.tar.bz2 rails-089da2e54db54c021681af1a31aadc2c0e15c1e0.zip |
hook mocha in through m/t before_setup, after_teardown hooks
Diffstat (limited to 'activesupport/lib/active_support/testing/mocha_module.rb')
-rw-r--r-- | activesupport/lib/active_support/testing/mocha_module.rb | 22 |
1 files changed, 22 insertions, 0 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 |