diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-13 02:36:17 -0800 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-11-13 02:36:17 -0800 |
commit | 395d6b43b8857ba1e8bbeec941576b4740c400e4 (patch) | |
tree | 107d9f00213a435d2772efa5fdf9f9b85ee61827 /activesupport/lib | |
parent | 8f3f50a3cca98a322083269562d446498825ad5f (diff) | |
parent | 57b333e25dc797f6023fb84adcf365bd3ca60509 (diff) | |
download | rails-395d6b43b8857ba1e8bbeec941576b4740c400e4.tar.gz rails-395d6b43b8857ba1e8bbeec941576b4740c400e4.tar.bz2 rails-395d6b43b8857ba1e8bbeec941576b4740c400e4.zip |
Merge pull request #8180 from freerange/mocha-fixes-supporting-only-0.13-onwards
Simplify code by taking advantage of latest mocha (v0.13.0).
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/test_case.rb | 8 | ||||
-rw-r--r-- | activesupport/lib/active_support/testing/mocha_module.rb | 22 |
2 files changed, 5 insertions, 25 deletions
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index 8b06739b7f..c96ad17aba 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -5,16 +5,18 @@ require 'active_support/testing/setup_and_teardown' require 'active_support/testing/assertions' require 'active_support/testing/deprecation' require 'active_support/testing/isolation' -require 'active_support/testing/mocha_module' require 'active_support/testing/constant_lookup' require 'active_support/core_ext/kernel/reporting' require 'active_support/deprecation' +begin + silence_warnings { require 'mocha/setup' } +rescue LoadError +end + module ActiveSupport class TestCase < ::MiniTest::Spec - include ActiveSupport::Testing::MochaModule - # Use AS::TestCase for the base class when describing a model register_spec_type(self) do |desc| Class === desc && desc < ActiveRecord::Base diff --git a/activesupport/lib/active_support/testing/mocha_module.rb b/activesupport/lib/active_support/testing/mocha_module.rb deleted file mode 100644 index 833dc867f0..0000000000 --- a/activesupport/lib/active_support/testing/mocha_module.rb +++ /dev/null @@ -1,22 +0,0 @@ -module ActiveSupport - module Testing - module MochaModule - begin - require 'mocha/api' - 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 |