mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Inherit from MiniTest::Unit::TestCase instead of MiniTest::Spec
This commit is contained in:
parent
d58d71f565
commit
eb4930e3c7
6 changed files with 3 additions and 29 deletions
|
@ -10,13 +10,6 @@ module ActionMailer
|
||||||
end
|
end
|
||||||
|
|
||||||
class TestCase < ActiveSupport::TestCase
|
class TestCase < ActiveSupport::TestCase
|
||||||
|
|
||||||
# Use AM::TestCase for the base class when describing a mailer
|
|
||||||
register_spec_type(self) do |desc|
|
|
||||||
Class === desc && desc < ActionMailer::Base
|
|
||||||
end
|
|
||||||
register_spec_type(/Mailer( ?Test)?\z/i, self)
|
|
||||||
|
|
||||||
module Behavior
|
module Behavior
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
|
|
@ -360,13 +360,6 @@ module ActionController
|
||||||
#
|
#
|
||||||
# assert_redirected_to page_url(title: 'foo')
|
# assert_redirected_to page_url(title: 'foo')
|
||||||
class TestCase < ActiveSupport::TestCase
|
class TestCase < ActiveSupport::TestCase
|
||||||
|
|
||||||
# Use AC::TestCase for the base class when describing a controller
|
|
||||||
register_spec_type(self) do |desc|
|
|
||||||
Class === desc && desc < ActionController::Metal
|
|
||||||
end
|
|
||||||
register_spec_type(/Controller( ?Test)?\z/i, self)
|
|
||||||
|
|
||||||
module Behavior
|
module Behavior
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
include ActionDispatch::TestProcess
|
include ActionDispatch::TestProcess
|
||||||
|
|
|
@ -491,9 +491,6 @@ module ActionDispatch
|
||||||
include ActionController::TemplateAssertions
|
include ActionController::TemplateAssertions
|
||||||
include ActionDispatch::Routing::UrlFor
|
include ActionDispatch::Routing::UrlFor
|
||||||
|
|
||||||
# Use AD::IntegrationTest for acceptance tests
|
|
||||||
register_spec_type(/(Acceptance|Integration) ?Test\z/i, self)
|
|
||||||
|
|
||||||
@@app = nil
|
@@app = nil
|
||||||
|
|
||||||
def self.app
|
def self.app
|
||||||
|
|
|
@ -30,9 +30,6 @@ module ActionView
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use AV::TestCase for the base class for helpers and views
|
|
||||||
register_spec_type(/(Helper|View)( ?Test)?\z/i, self)
|
|
||||||
|
|
||||||
module Behavior
|
module Behavior
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
gem 'minitest' # make sure we get the gem, not stdlib
|
gem 'minitest' # make sure we get the gem, not stdlib
|
||||||
require 'minitest/spec'
|
require 'minitest/unit'
|
||||||
require 'active_support/testing/tagged_logging'
|
require 'active_support/testing/tagged_logging'
|
||||||
require 'active_support/testing/setup_and_teardown'
|
require 'active_support/testing/setup_and_teardown'
|
||||||
require 'active_support/testing/assertions'
|
require 'active_support/testing/assertions'
|
||||||
|
@ -17,13 +17,7 @@ rescue LoadError
|
||||||
end
|
end
|
||||||
|
|
||||||
module ActiveSupport
|
module ActiveSupport
|
||||||
class TestCase < ::MiniTest::Spec
|
class TestCase < ::MiniTest::Unit::TestCase
|
||||||
|
|
||||||
# Use AS::TestCase for the base class when describing a model
|
|
||||||
register_spec_type(self) do |desc|
|
|
||||||
Class === desc && desc < ActiveRecord::Base
|
|
||||||
end
|
|
||||||
|
|
||||||
Assertion = MiniTest::Assertion
|
Assertion = MiniTest::Assertion
|
||||||
alias_method :method_name, :__name__
|
alias_method :method_name, :__name__
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'abstract_unit'
|
require 'abstract_unit'
|
||||||
|
|
||||||
class EngineTest < ActiveSupport::TestCase
|
class EngineTest < ActiveSupport::TestCase
|
||||||
it "reports routes as available only if they're actually present" do
|
test "reports routes as available only if they're actually present" do
|
||||||
engine = Class.new(Rails::Engine) do
|
engine = Class.new(Rails::Engine) do
|
||||||
def initialize(*args)
|
def initialize(*args)
|
||||||
@routes = nil
|
@routes = nil
|
||||||
|
|
Loading…
Reference in a new issue