Posts tagged with sort (2)

Jan21 RSpec simple matcher to specify an array should be sorted post author

rspec matcher array sort | comments

RSpec is a lot about readability. And its matchers are really a joy to aid you on that. And now it is even easier to add simple matchers for (in David’s own words) you to create your own custom matchers in just a few lines of code when you don’t need all the power of a completely custom matcher object.

Continue reading »

Apr14 Sorting arrays of any object in Ruby post author

arrays sorting | comments

Today I needed in my test units to assert whether arrays of Active Records objects were equal or not. That requires me to sort the arrays, since order is important when checking for equality of arrays.

Continue reading »