{"action":"created","issue":{"url":"https://api.github.com/repos/rspec/rspec-expectations/issues/812","labels_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/812/labels{/name}","comments_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/812/comments","events_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/812/events","html_url":"https://github.com/rspec/rspec-expectations/issues/812","id":91879567,"number":812,"title":"`contain_exactly` fails on an unsortable array","user":{"login":"dividedmind","id":823636,"avatar_url":"https://avatars.githubusercontent.com/u/823636?v=3","gravatar_id":"","url":"https://api.github.com/users/dividedmind","html_url":"https://github.com/dividedmind","followers_url":"https://api.github.com/users/dividedmind/followers","following_url":"https://api.github.com/users/dividedmind/following{/other_user}","gists_url":"https://api.github.com/users/dividedmind/gists{/gist_id}","starred_url":"https://api.github.com/users/dividedmind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dividedmind/subscriptions","organizations_url":"https://api.github.com/users/dividedmind/orgs","repos_url":"https://api.github.com/users/dividedmind/repos","events_url":"https://api.github.com/users/dividedmind/events{/privacy}","received_events_url":"https://api.github.com/users/dividedmind/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-29T18:48:26Z","updated_at":"2015-06-29T18:50:49Z","closed_at":"2015-06-29T18:50:49Z","body":"I've been upgrading a project from RSpec 2 and got new failures after transpec and changing to RSpec 3. Those seem to be related to `contain_exactly` trying to sort arrays, but the types being incomparable, for example:\r\n\r\n```\r\n  1) WidgetsController audit methods #audit_index_forbidden populates the event\r\n     Failure/Error: expect(event[:widgets]).to contain_exactly(widget_ids << current_widget)\r\n     ArgumentError:\r\n       comparison of String with RSpec::Mocks::Double failed\r\n     # ./spec/support/matchers/contains_exactly.rb:23:in `sort'\r\n     # ./spec/support/matchers/contains_exactly.rb:23:in `match_when_sorted?'\r\n     # ./spec/support/matchers/contains_exactly.rb:32:in `block (2 levels) in <top (required)>'\r\n     # ./spec/controllers/widget_controller_spec.rb:77:in `block (5 levels) in <top (required)>'\r\n     # [...]\r\n```\r\n\r\nNote this is a change of behaviour compared to RSpec 2 (the tests were green before changing the version in Gemfile to 3)."},"comment":{"url":"https://api.github.com/repos/rspec/rspec-expectations/issues/comments/116794911","html_url":"https://github.com/rspec/rspec-expectations/issues/812#issuecomment-116794911","issue_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/812","id":116794911,"user":{"login":"dividedmind","id":823636,"avatar_url":"https://avatars.githubusercontent.com/u/823636?v=3","gravatar_id":"","url":"https://api.github.com/users/dividedmind","html_url":"https://github.com/dividedmind","followers_url":"https://api.github.com/users/dividedmind/followers","following_url":"https://api.github.com/users/dividedmind/following{/other_user}","gists_url":"https://api.github.com/users/dividedmind/gists{/gist_id}","starred_url":"https://api.github.com/users/dividedmind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dividedmind/subscriptions","organizations_url":"https://api.github.com/users/dividedmind/orgs","repos_url":"https://api.github.com/users/dividedmind/repos","events_url":"https://api.github.com/users/dividedmind/events{/privacy}","received_events_url":"https://api.github.com/users/dividedmind/received_events","type":"User","site_admin":false},"created_at":"2015-06-29T18:50:49Z","updated_at":"2015-06-29T18:50:49Z","body":"Whoops, just realized the matcher comes from my own code (although it's lifted from rspec). Closing pending investigation (ie. why did it work in RSpec 2?). Sorry!"}}