Skip to content
This repository
Ryan Bates
file 13 lines (11 sloc) 0.459 kb
1 2 3 4 5 6 7 8 9 10 11 12 13
RSpec::Matchers.define :orderlessly_match do |original_string|
  match do |given_string|
    original_string.split('').sort == given_string.split('').sort
  end

  failure_message_for_should do |given_string|
    "expected \"#{given_string}\" to have the same characters as \"#{original_string}\""
  end

  failure_message_for_should_not do |given_string|
    "expected \"#{given_string}\" not to have the same characters as \"#{original_string}\""
  end
end
Something went wrong with that request. Please try again.