RSpec matcher "be_sorted"

Updated . Posted . Visible to the public.
RSpec::Matchers.define :be_naturally_sorted do
  match do |array|
    array == array.natural_sort
  end
end

See RSpec: Where to put custom matchers and other support code. To use natural_sort, see this card.


This matcher is now part of Spreewald Show archive.org snapshot .

Dominik Schöler
Last edit
Dominik Schöler
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2014-12-19 16:22)