[rspec-users] Can I do foo.should (be_nil || be_empty) in rspec

Andrew Premdas apremdas at gmail.com
Tue Nov 4 07:45:31 EST 2008

General case I'm thinking about is just testing that something should be one
thing or another
   e.g x.should be(foo || bar)

Haven't got a specific example at the moment apart from the blank one.  What
I'm thinking about is the syntax to say this in a spec, as I think there
must be lots of times when having this sort of syntax would be useful.

All best


2008/11/4 Ashley Moran <ashley.moran at patchspace.co.uk>

> On 4 Nov 2008, at 11:26, Andrew Premdas wrote:
>  Any ideas about the general case, is making a custom matcher the (only)
>> way to go?
> Can you give an example of what you're doing, or think you might do?  Until
> I saw Tom's reply it never occurred to me that you might be dealing with
> strings (I thought you were doing something with an array or other
> collection.)
> Ashley
> --
> http://www.patchspace.co.uk/
> http://aviewfromafar.net/
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081104/5de876ef/attachment.html>

More information about the rspec-users mailing list