Skip to content
Browse files

if the sort fails, rescue and return the array as-is

  • Loading branch information...
1 parent 00fe65f commit b096533595cb77629b0ea0897b2e7256cfadd19b @pvh committed Jul 13, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/rspec/matchers/match_array.rb
View
2 lib/rspec/matchers/match_array.rb
@@ -34,7 +34,7 @@ def description
private
def safe_sort(array)
- array.all?{|item| item.respond_to?(:<=>)} ? array.sort : array
+ array.sort rescue array
end
def difference_between_arrays(array_1, array_2)

0 comments on commit b096533

Please sign in to comment.
Something went wrong with that request. Please try again.