提交 395d6b43 编写于 作者: C Carlos Antonio da Silva

Merge pull request #8180 from freerange/mocha-fixes-supporting-only-0.13-onwards

Simplify code by taking advantage of latest mocha (v0.13.0).
......@@ -5,16 +5,18 @@
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
......
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册