Skip to content

Commit

Permalink
ruby-1.9 raises argument error when trying to sort unsortable objects
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Oct 9, 2010
1 parent 3a89417 commit 4a6a684
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion spec/spec/matchers/match_array_spec.rb
Expand Up @@ -66,7 +66,8 @@ def ==(other)
MESSAGE
end

it "should not sort items in the error message if they don't all respond to <=>" do
it "should not sort items in the error message if they don't all respond to <=>" do
with_ruby 1.8 do
lambda {
[UnsortableObject.new(2), UnsortableObject.new(1)].should =~ [UnsortableObject.new(4), UnsortableObject.new(3)]
}.should fail_with(<<-MESSAGE)
Expand All @@ -76,6 +77,7 @@ def ==(other)
the extra elements were: [2, 1]
MESSAGE
end
end

it "should accurately report extra elements when there are duplicates" do
lambda {
Expand Down

0 comments on commit 4a6a684

Please sign in to comment.