{"action":"created","issue":{"url":"https://api.github.com/repos/rspec/rspec-expectations/issues/807","labels_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/807/labels{/name}","comments_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/807/comments","events_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/807/events","html_url":"https://github.com/rspec/rspec-expectations/pull/807","id":90039490,"number":807,"title":"This adds the `any`-matcher","user":{"login":"dg-ratiodata","id":1267524,"avatar_url":"https://avatars.githubusercontent.com/u/1267524?v=3","gravatar_id":"","url":"https://api.github.com/users/dg-ratiodata","html_url":"https://github.com/dg-ratiodata","followers_url":"https://api.github.com/users/dg-ratiodata/followers","following_url":"https://api.github.com/users/dg-ratiodata/following{/other_user}","gists_url":"https://api.github.com/users/dg-ratiodata/gists{/gist_id}","starred_url":"https://api.github.com/users/dg-ratiodata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dg-ratiodata/subscriptions","organizations_url":"https://api.github.com/users/dg-ratiodata/orgs","repos_url":"https://api.github.com/users/dg-ratiodata/repos","events_url":"https://api.github.com/users/dg-ratiodata/events{/privacy}","received_events_url":"https://api.github.com/users/dg-ratiodata/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-22T08:12:48Z","updated_at":"2015-06-22T15:59:33Z","closed_at":"2015-06-22T15:02:27Z","pull_request":{"url":"https://api.github.com/repos/rspec/rspec-expectations/pulls/807","html_url":"https://github.com/rspec/rspec-expectations/pull/807","diff_url":"https://github.com/rspec/rspec-expectations/pull/807.diff","patch_url":"https://github.com/rspec/rspec-expectations/pull/807.patch"},"body":"You guys already added the `all`-matcher. This is very helpful. Unfortunately there's no `any`-matcher available. I hope I do not oversaw a similar functionality.\r\n\r\nTo have the `any`-matcher along this would make code at cucumber/aurba easier. This PR adds this matcher. It is based on the `All`-matcher and is a sub-class of this and re-uses most code given there.\r\n\r\nBTW:\r\nThis PR also changes the behaviour of `all` when an exception - aka `ArgumentError` - is raised. Now the `matches`-call is wrapped with in a `begin; end`-block to make it check all objects and not to stop on the first one where the exception occured."},"comment":{"url":"https://api.github.com/repos/rspec/rspec-expectations/issues/comments/114163583","html_url":"https://github.com/rspec/rspec-expectations/pull/807#issuecomment-114163583","issue_url":"https://api.github.com/repos/rspec/rspec-expectations/issues/807","id":114163583,"user":{"login":"dg-ratiodata","id":1267524,"avatar_url":"https://avatars.githubusercontent.com/u/1267524?v=3","gravatar_id":"","url":"https://api.github.com/users/dg-ratiodata","html_url":"https://github.com/dg-ratiodata","followers_url":"https://api.github.com/users/dg-ratiodata/followers","following_url":"https://api.github.com/users/dg-ratiodata/following{/other_user}","gists_url":"https://api.github.com/users/dg-ratiodata/gists{/gist_id}","starred_url":"https://api.github.com/users/dg-ratiodata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dg-ratiodata/subscriptions","organizations_url":"https://api.github.com/users/dg-ratiodata/orgs","repos_url":"https://api.github.com/users/dg-ratiodata/repos","events_url":"https://api.github.com/users/dg-ratiodata/events{/privacy}","received_events_url":"https://api.github.com/users/dg-ratiodata/received_events","type":"User","site_admin":false},"created_at":"2015-06-22T15:59:33Z","updated_at":"2015-06-22T15:59:33Z","body":"> include already provides the same capability. expect(list).to include(a_value > 10) passes if list.any? { |x| x > 10 }.\r\n\r\nWill this work with `it { expect(all_commands).to include have_output(\"foo\") }`? If yes, does it makes sense to add a new alias `have_at_least_one_member` to make it more readable?\r\n\r\n>  expect(list).to all be_odd reads like English; but expect(list).to any be_odd is completely nonsensical to a native English speaker. (I'm actually not sure of the grammatical reasons for why that is.)\r\n\r\nMmh, if this really is the problem, I could add some aliases for this:\r\n\r\n```ruby\r\nit { expect([1, 3, 11]).to have_any_member( be < 10 ) }\r\nit { expect([1, 3, 11]).to have_a_member( be < 10 ) }\r\nit { expect([1, 3, 11]).to have_at_least_one_member( be < 10 ) }\r\n```\r\n\r\n> Want to work up a separate PR that fixes the be < matcher?\r\n> Also, if you want to work up a PR to improve our all docs to mention that we have include instead of any we could merge that.\r\n\r\nYes, will do that for both tomorrow."}}