1 Star 0 Fork 22

starlet_dx/rubygem-actionpack

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
rubygem-actionpack-7.0.2.3-Fix-tests-for-minitest-5.16.patch 6.56 KB
一键复制 编辑 原始数据 按行查看 历史
wk333 提交于 2023-01-19 11:41 . Upgrade to version 7.0.4
From 9766eb4a833c26c64012230b96dd1157ebb8e8a2 Mon Sep 17 00:00:00 2001
From: eileencodes <eileencodes@gmail.com>
Date: Wed, 15 Jun 2022 12:44:11 -0400
Subject: [PATCH] Fix tests for minitest 5.16
In minitest/minitest@6e06ac9 minitest changed such that it now accepts
`kwargs` instead of requiring kwargs to be shoved into the args array.
This is a good change but required some updates to our test code to get
the new version of minitest passing.
Changes are as follows:
1) Lock minitest to 5.15 for Ruby 2.7. We don't love this change but
it's pretty difficult to get 2.7 and 3.0 to play nicely together with
the new kwargs changes. Dropping 2.7 support isn't an option right
now for Rails. This is safe because all of the code changes here are
internal methods to Rails like assert_called_with. Applications
shouldn't be consuming them as they are no-doc'd.
2) Update the `assert_called_with` method to take any kwargs but also
the returns kwarg.
3) Update callers of `assert_called_with` to move the kwargs outside the
args array.
4) Update the message from marshaled exceptions. In 5.16 the exception
message is "result not reported" instead of "Wrapped undumpable
exception".
Co-authored-by: Matthew Draper <matthew@trebex.net>
---
.../test/controller/integration_test.rb | 26 ++---
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 2fcd56e71a589..99f92b3c3d07c 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -36,91 +36,91 @@ def test_follow_redirect_raises_when_no_redirect
def test_get
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:get, path, params: params, headers: headers] do
+ assert_called_with @session, :process, [:get, path], params: params, headers: headers do
@session.get(path, params: params, headers: headers)
end
end
def test_get_with_env_and_headers
path = "/index"; params = "blah"; headers = { location: "blah" }; env = { "HTTP_X_REQUESTED_WITH" => "XMLHttpRequest" }
- assert_called_with @session, :process, [:get, path, params: params, headers: headers, env: env] do
+ assert_called_with @session, :process, [:get, path], params: params, headers: headers, env: env do
@session.get(path, params: params, headers: headers, env: env)
end
end
def test_post
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:post, path, params: params, headers: headers] do
+ assert_called_with @session, :process, [:post, path], params: params, headers: headers do
@session.post(path, params: params, headers: headers)
end
end
def test_patch
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:patch, path, params: params, headers: headers] do
+ assert_called_with @session, :process, [:patch, path], params: params, headers: headers do
@session.patch(path, params: params, headers: headers)
end
end
def test_put
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:put, path, params: params, headers: headers] do
+ assert_called_with @session, :process, [:put, path], params: params, headers: headers do
@session.put(path, params: params, headers: headers)
end
end
def test_delete
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:delete, path, params: params, headers: headers] do
+ assert_called_with @session, :process, [:delete, path], params: params, headers: headers do
@session.delete(path, params: params, headers: headers)
end
end
def test_head
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:head, path, params: params, headers: headers] do
+ assert_called_with @session, :process, [:head, path], params: params, headers: headers do
@session.head(path, params: params, headers: headers)
end
end
def test_xml_http_request_get
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:get, path, params: params, headers: headers, xhr: true] do
+ assert_called_with @session, :process, [:get, path], params: params, headers: headers, xhr: true do
@session.get(path, params: params, headers: headers, xhr: true)
end
end
def test_xml_http_request_post
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:post, path, params: params, headers: headers, xhr: true] do
+ assert_called_with @session, :process, [:post, path], params: params, headers: headers, xhr: true do
@session.post(path, params: params, headers: headers, xhr: true)
end
end
def test_xml_http_request_patch
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:patch, path, params: params, headers: headers, xhr: true] do
+ assert_called_with @session, :process, [:patch, path], params: params, headers: headers, xhr: true do
@session.patch(path, params: params, headers: headers, xhr: true)
end
end
def test_xml_http_request_put
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:put, path, params: params, headers: headers, xhr: true] do
+ assert_called_with @session, :process, [:put, path], params: params, headers: headers, xhr: true do
@session.put(path, params: params, headers: headers, xhr: true)
end
end
def test_xml_http_request_delete
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:delete, path, params: params, headers: headers, xhr: true] do
+ assert_called_with @session, :process, [:delete, path], params: params, headers: headers, xhr: true do
@session.delete(path, params: params, headers: headers, xhr: true)
end
end
def test_xml_http_request_head
path = "/index"; params = "blah"; headers = { location: "blah" }
- assert_called_with @session, :process, [:head, path, params: params, headers: headers, xhr: true] do
+ assert_called_with @session, :process, [:head, path], params: params, headers: headers, xhr: true do
@session.head(path, params: params, headers: headers, xhr: true)
end
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/starlet-dx/rubygem-actionpack.git
git@gitee.com:starlet-dx/rubygem-actionpack.git
starlet-dx
rubygem-actionpack
rubygem-actionpack
master

搜索帮助