Ticket #236 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

[PATCH] multipart spec fails on JRuby due to hash ordering

Reported by: dudl..@misnomer.us Assigned to: e.@brainspl.at
Priority: major Milestone: 0.3.x
Component: Merb Keywords:
Cc:

Description

The spec for Merb::Test::Multipart::Post#to_multipart fails due to hash ordering differences between JRuby and MRI. This patch makes Merb::Test::Multipart::Post sort its params so they come out in a consistent order.

Attachments

multipart_spec_hash_order.diff (1.5 kB) - added by dudl..@misnomer.us on 10/20/07 19:47:16.
multipart_spec_hash_order2.diff (1.5 kB) - added by dudl..@misnomer.us on 10/20/07 21:01:00.

Change History

10/20/07 19:47:16 changed by dudl..@misnomer.us

  • attachment multipart_spec_hash_order.diff added.

10/20/07 20:15:21 changed by e.@brainspl.at

  • owner set to e.@brainspl.at.
  • status changed from new to assigned.

This patch breaks the specs for normal ruby since you cannot call <=> on symbols

<pre> 1) NoMethodError? in 'Merb::Request should handle hash-style form fields in multipart/form-data' undefined method `<=>' for :foo:Symbol ./spec/merb/../../lib/merb/test/multipart.rb:42:in `<=>' ./spec/merb/../../lib/merb/test/multipart.rb:42:in `sort' ./spec/merb/../../lib/merb/test/multipart.rb:42:in `push_params' ./spec/merb/../../lib/merb/test/multipart.rb:38:in `initialize' ./spec/merb/request_spec.rb:125:in `new' ./spec/merb/request_spec.rb:125: </pre>

10/20/07 21:01:00 changed by dudl..@misnomer.us

  • attachment multipart_spec_hash_order2.diff added.

10/20/07 21:06:03 changed by dudl..@misnomer.us

You can't do that on JRuby, either. Apparently jrake specs doesn't run all the specs for me. I've updated the patch to sort on stringified keys.

10/21/07 09:08:23 changed by iv..@gweezlebur.com

  • summary changed from multipart spec fails on JRuby due to hash ordering to [PATCH] multipart spec fails on JRuby due to hash ordering.

10/24/07 12:45:07 changed by e.@brainspl.at

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [762]) Applying all dudleys patches to make merb work under jruby, fell back tp json_pure gem but will still try to load the C ext first before falling back to the pure version. closes #231, closes #232, closes #236, closes #242, closes #235 Thanks dudley