[rspec-devel] [ rspec-Feature Requests-9304 ] should_all <predicate>

noreply at rubyforge.org noreply at rubyforge.org
Thu Mar 15 11:11:06 EDT 2007


Feature Requests item #9304, was opened at 2007-03-15 14:58
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9304&group_id=797

Category: expectation module
Group: None
Status: Open
Priority: 3
Submitted By: Chris Hoffman (hoffman_c)
Assigned to: Nobody (None)
Summary: should_all <predicate>

Initial Comment:
Hello,
  In order to check the properties of each element in a collection, one must presently do the following (as far as I can tell):

mycollection = [2,3,5,7]
mycollection.each { |num| num.should_be_prime }

I suggest an improvement that would significantly increase the readability of these statement types:

mycollection.should_all be_prime

Keep up the good work!  This software has made me into a better programmer.


----------------------------------------------------------------------

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-03-15 15:11

Message:
How about:

mycollection.should all_be_prime

Then we don't further pollute Object.

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=9304&group_id=797


More information about the rspec-devel mailing list