Skip to content

Commit

Permalink
MethodCallAssertions is a regular player of the team ActiveSupport::T…
Browse files Browse the repository at this point in the history
…estCase now

It's used everywhere, clean and mature enough
  • Loading branch information
amatsuda committed Aug 1, 2019
1 parent 4f1bd29 commit 98d0f7e
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 28 deletions.
3 changes: 0 additions & 3 deletions actioncable/test/test_helper.rb
Expand Up @@ -2,7 +2,6 @@

require "action_cable"
require "active_support/testing/autorun"
require "active_support/testing/method_call_assertions"

require "puma"
require "rack/mock"
Expand All @@ -20,8 +19,6 @@
ActionCable.server.config.logger = Logger.new(nil)

class ActionCable::TestCase < ActiveSupport::TestCase
include ActiveSupport::Testing::MethodCallAssertions

def wait_for_async
wait_for_executor Concurrent.global_io_executor
end
Expand Down
3 changes: 0 additions & 3 deletions actionmailer/test/abstract_unit.rb
Expand Up @@ -16,7 +16,6 @@ def self.root
end

require "active_support/testing/autorun"
require "active_support/testing/method_call_assertions"
require "action_mailer"
require "action_mailer/test_case"

Expand All @@ -36,8 +35,6 @@ def self.root
ActionMailer::Base.delivery_job = ActionMailer::MailDeliveryJob

class ActiveSupport::TestCase
include ActiveSupport::Testing::MethodCallAssertions

private
# Skips the current run on Rubinius using Minitest::Assertions#skip
def rubinius_skip(message = "")
Expand Down
4 changes: 0 additions & 4 deletions actionpack/test/abstract_unit.rb
Expand Up @@ -350,11 +350,7 @@ class CommentsController < ResourcesController; end
class AccountsController < ResourcesController; end
class ImagesController < ResourcesController; end

require "active_support/testing/method_call_assertions"

class ActiveSupport::TestCase
include ActiveSupport::Testing::MethodCallAssertions

private
# Skips the current run on Rubinius using Minitest::Assertions#skip
def rubinius_skip(message = "")
Expand Down
3 changes: 0 additions & 3 deletions actionview/test/abstract_unit.rb
Expand Up @@ -16,7 +16,6 @@
end

require "active_support/testing/autorun"
require "active_support/testing/method_call_assertions"
require "action_controller"
require "action_view"
require "action_view/testing/resolvers"
Expand Down Expand Up @@ -194,8 +193,6 @@ def stderr_logger
class ActiveSupport::TestCase
parallelize

include ActiveSupport::Testing::MethodCallAssertions

private
# Skips the current run on Rubinius using Minitest::Assertions#skip
def rubinius_skip(message = "")
Expand Down
3 changes: 0 additions & 3 deletions activemodel/test/cases/helper.rb
Expand Up @@ -9,12 +9,9 @@
I18n.enforce_available_locales = false

require "active_support/testing/autorun"
require "active_support/testing/method_call_assertions"
require "active_support/core_ext/integer/time"

class ActiveModel::TestCase < ActiveSupport::TestCase
include ActiveSupport::Testing::MethodCallAssertions

private
# Skips the current run on Rubinius using Minitest::Assertions#skip
def rubinius_skip(message = "")
Expand Down
2 changes: 0 additions & 2 deletions activerecord/test/cases/test_case.rb
Expand Up @@ -2,7 +2,6 @@

require "active_support"
require "active_support/testing/autorun"
require "active_support/testing/method_call_assertions"
require "active_support/testing/stream"
require "active_record/fixtures"

Expand All @@ -13,7 +12,6 @@ module ActiveRecord
#
# Defines some test assertions to test against SQL queries.
class TestCase < ActiveSupport::TestCase #:nodoc:
include ActiveSupport::Testing::MethodCallAssertions
include ActiveSupport::Testing::Stream
include ActiveRecord::TestFixtures
include ActiveRecord::ValidationsRepairHelper
Expand Down
3 changes: 0 additions & 3 deletions activestorage/test/models/blob_test.rb
Expand Up @@ -2,11 +2,8 @@

require "test_helper"
require "database/setup"
require "active_support/testing/method_call_assertions"

class ActiveStorage::BlobTest < ActiveSupport::TestCase
include ActiveSupport::Testing::MethodCallAssertions

test "unattached scope" do
[ create_blob(filename: "funky.jpg"), create_blob(filename: "town.jpg") ].tap do |blobs|
User.create! name: "DHH", avatar: blobs.first
Expand Down
3 changes: 3 additions & 0 deletions activesupport/lib/active_support/test_case.rb
Expand Up @@ -5,6 +5,7 @@
require "active_support/testing/tagged_logging"
require "active_support/testing/setup_and_teardown"
require "active_support/testing/assertions"
require "active_support/testing/method_call_assertions"
require "active_support/testing/deprecation"
require "active_support/testing/declarative"
require "active_support/testing/isolation"
Expand Down Expand Up @@ -137,11 +138,13 @@ def parallelize_teardown(&block)
include ActiveSupport::Testing::TaggedLogging
prepend ActiveSupport::Testing::SetupAndTeardown
include ActiveSupport::Testing::Assertions
include ActiveSupport::Testing::MethodCallAssertions
include ActiveSupport::Testing::Deprecation
include ActiveSupport::Testing::TimeHelpers
include ActiveSupport::Testing::FileFixtures
extend ActiveSupport::Testing::Declarative


# test/unit backwards compatibility methods
alias :assert_raise :assert_raises
alias :assert_not_empty :refute_empty
Expand Down
3 changes: 0 additions & 3 deletions activesupport/test/abstract_unit.rb
Expand Up @@ -10,7 +10,6 @@
end

require "active_support/testing/autorun"
require "active_support/testing/method_call_assertions"

ENV["NO_RELOAD"] = "1"
require "active_support"
Expand All @@ -27,8 +26,6 @@
I18n.enforce_available_locales = false

class ActiveSupport::TestCase
include ActiveSupport::Testing::MethodCallAssertions

private
# Skips the current run on Rubinius using Minitest::Assertions#skip
def rubinius_skip(message = "")
Expand Down
2 changes: 0 additions & 2 deletions railties/test/generators/generators_test_helper.rb
Expand Up @@ -3,7 +3,6 @@
require "abstract_unit"
require "active_support/core_ext/module/remove_method"
require "active_support/testing/stream"
require "active_support/testing/method_call_assertions"
require "rails/generators"
require "rails/generators/test_case"

Expand All @@ -28,7 +27,6 @@ def root

module GeneratorsTestHelper
include ActiveSupport::Testing::Stream
include ActiveSupport::Testing::MethodCallAssertions

GemfileEntry = Struct.new(:name, :version, :comment, :options, :commented_out) do
def initialize(name, version, comment, options = {}, commented_out = false)
Expand Down
2 changes: 0 additions & 2 deletions railties/test/isolation/abstract_unit.rb
Expand Up @@ -14,7 +14,6 @@
require "active_support"
require "active_support/testing/autorun"
require "active_support/testing/stream"
require "active_support/testing/method_call_assertions"
require "active_support/test_case"
require "minitest/retry"

Expand Down Expand Up @@ -495,7 +494,6 @@ class ActiveSupport::TestCase
include TestHelpers::Generation
include TestHelpers::Reload
include ActiveSupport::Testing::Stream
include ActiveSupport::Testing::MethodCallAssertions
end

# Create a scope and build a fixture rails app
Expand Down

1 comment on commit 98d0f7e

@rafaelfranca
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We never want to publish this framework. We don't want to maintain a mocha alternative. I'll revert this commit.

Please sign in to comment.