File: use-params-not-body.patch

package info (click to toggle)
ruby-rack-parser 0.7.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 160 kB
  • sloc: ruby: 172; makefile: 4
file content (39 lines) | stat: -rw-r--r-- 1,450 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Description: Fix test expectations for Ruby 3.4 Hash#inspect change
 Ruby 3.4 changed Hash#inspect output for non-symbol keys to add spaces
 around => ({"a" => 1} instead of {"a"=>1}). The test suite relied on the
 old format via last_response.body, causing FTBFS only on ruby3.4.
Author: Simon Quigley <tsimonq2@debian.org>
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-03-06
---
This patch header follows DEP-3: https://dep.debian.net/deps/dep3/
--- a/spec/parser_spec.rb
+++ b/spec/parser_spec.rb
@@ -25,7 +25,7 @@ describe Rack::Parser do
     post '/post', payload, { 'CONTENT_TYPE' => 'application/json' }
 
     assert last_response.ok?
-    assert_equal "{\"a\"=>1}", last_response.body
+    assert_equal({"a" => 1}, last_request.params)
   end
 
   it "does nothing if unmatched Content-Type" do
@@ -45,7 +45,7 @@ describe Rack::Parser do
     post '/post', payload, { 'CONTENT_TYPE' => 'application/vnd.foo+json' }
 
     assert last_response.ok?
-    assert_equal "{\"a\"=>2}", last_response.body
+    assert_equal({"a" => 2}, last_request.params)
   end
 
   it 'matches ambiguous string Content-Type and forces explicit regex' do
@@ -55,7 +55,7 @@ describe Rack::Parser do
     post '/post', payload, { 'CONTENT_TYPE' => 'application/vnd.foo+json' }
 
     assert last_response.ok?
-    assert_equal "{\"a\"=>2}", last_response.body
+    assert_equal({"a" => 2}, last_request.params)
   end
 
   it "handles upstream errors" do