From df0de681dc1873534ecd2fc8371e1f2562984b68 Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Thu, 16 Jun 2022 08:34:05 -0400 Subject: [PATCH] Remove the multi-call form of assert_called_with The `assert_called_with` helper allows passing a multi-dimensional array to mock multiple calls to the same method for a given block. This works fine now, but when adding support for real kwargs arguments to line up with recent upgrades in Minitest, this approach is no longer workable because we can't pass multiple sets of differing kwargs. Rather than complicated this method further, this commit removes the multi-call form of `assert_called_with` and modifies the tests that currently make use of that functionality to just use the underlying `Minitest::Mock` calls. Co-authored-by: Eileen M. Uchitelle --- .../testing/method_call_assertions_test.rb | 7 -- 1 file changed, 7 deletions(-) diff --git a/activesupport/test/testing/method_call_assertions_test.rb b/activesupport/test/testing/method_call_assertions_test.rb index e75630d2e4228..4d59e0bd3c222 100644 --- a/activesupport/test/testing/method_call_assertions_test.rb +++ b/activesupport/test/testing/method_call_assertions_test.rb @@ -82,13 +82,6 @@ def test_assert_called_with_failure end end - def test_assert_called_with_multiple_expected_arguments - assert_called_with(@object, :<<, [ [ 1 ], [ 2 ] ]) do - @object << 1 - @object << 2 - end - end - def test_assert_called_on_instance_of_with_defaults_to_expect_once assert_called_on_instance_of Level, :increment do @object.increment