Permalink
Browse files

Inherit from MiniTest::Unit::TestCase instead of MiniTest::Spec

  • Loading branch information...
1 parent d58d71f commit eb4930e3c724cf71d6ce5bb2aec4af82b2025b03 @rafaelfranca rafaelfranca committed Dec 28, 2012
@@ -10,13 +10,6 @@ def initialize(name)
end
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
extend ActiveSupport::Concern
@@ -360,13 +360,6 @@ def exists?
#
# assert_redirected_to page_url(title: 'foo')
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
extend ActiveSupport::Concern
include ActionDispatch::TestProcess
@@ -491,9 +491,6 @@ class IntegrationTest < ActiveSupport::TestCase
include ActionController::TemplateAssertions
include ActionDispatch::Routing::UrlFor
- # Use AD::IntegrationTest for acceptance tests
- register_spec_type(/(Acceptance|Integration) ?Test\z/i, self)
-
@@app = nil
def self.app
@@ -30,9 +30,6 @@ def initialize
end
end
- # Use AV::TestCase for the base class for helpers and views
- register_spec_type(/(Helper|View)( ?Test)?\z/i, self)
-
module Behavior
extend ActiveSupport::Concern
@@ -1,5 +1,5 @@
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/setup_and_teardown'
require 'active_support/testing/assertions'
@@ -17,13 +17,7 @@
end
module ActiveSupport
- class TestCase < ::MiniTest::Spec
-
- # Use AS::TestCase for the base class when describing a model
- register_spec_type(self) do |desc|
- Class === desc && desc < ActiveRecord::Base
- end
-
+ class TestCase < ::MiniTest::Unit::TestCase
Assertion = MiniTest::Assertion
alias_method :method_name, :__name__
@@ -1,7 +1,7 @@
require 'abstract_unit'
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
def initialize(*args)
@routes = nil

3 comments on commit eb4930e

@rainerfrey

I'm curious as to why this change is made. Was this discussed publicly?

@jeremy
Member
jeremy commented on eb4930e Apr 12, 2013

We didn't need the spec dsl in core. It's provided as a plugin: https://github.com/metaskills/minitest-spec-rails

@rainerfrey

I see. Thanks for the info.

Please sign in to comment.