[rspec-users] be_none and be_any don't seem to work properly

Tom Stuart tom at experthuman.com
Wed Nov 4 10:23:16 EST 2009


On 21 Oct 2009, at 16:45, David Chelimsky wrote:
> On Oct 19, 2009, at 2:12 PM, iain wrote:
>> I use be_all(&:some_predicate) to test if all the elements in the  
>> collection are valid, which works, but when I try to test the  
>> inverse, it fails.
> I'm not certain, but I _think_ that the problem is the way you're  
> setting up the factories.

I don't think be_all(&:some_predicate) actually works at all, except  
in the accidental sense that Enumerable#all indiscriminately returns  
true as long as all of the entries in the collection are truthy.

At the moment it looks like dynamic predicate matchers like be_all  
completely ignore their block argument (&:some_predicate doesn't get  
rolled into *args) so you just get the default blockless behaviour of  
the underlying predicate.

I've reported and patched this on Lighthouse: https://rspec.lighthouseapp.com/projects/5645-rspec/tickets/905

Cheers,
-Tom


More information about the rspec-users mailing list