mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #8180 from freerange/mocha-fixes-supporting-only-0.13-onwards
Simplify code by taking advantage of latest mocha (v0.13.0).
This commit is contained in:
commit
395d6b43b8
2 changed files with 5 additions and 25 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
Loading…
Reference in a new issue