webmock icon indicating copy to clipboard operation
webmock copied to clipboard

Failing spec to expose problem mentioned in #384

Open mikegee opened this issue 10 years ago • 4 comments

mikegee avatar Jun 12 '15 22:06 mikegee

I suspect this spec doesn't belong here. And, I haven't looked into the implementation yet. Helpful suggestions are welcome.

mikegee avatar Jun 12 '15 22:06 mikegee

lib/webmock/util/query_mapper.rb:199 is:

new_query_values.sort!

In my example, new_query_values is:

[["tags[]", {"baz"=>"quux"}], ["tags[]", {"foo"=>"bar"}]]

Sorting this is problematic because:

{'baz'=>'quux'} <=> {'foo'=>'bar'} # => nil

Array#sort! doesn't like nils.

mikegee avatar Jun 13 '15 02:06 mikegee

I rewrote the spec and moved it to a better home.

mikegee avatar Jun 13 '15 02:06 mikegee

Thank you @mikegee This should help when developing the fix.

bblimke avatar Jun 13 '15 22:06 bblimke