[rspec-users] Using Predicates to look at an array..
Geoffrey Wiseman
geoffrey.wiseman at gmail.com
Thu Oct 4 13:07:35 EDT 2007
On 10/4/07, Eric Pugh <epugh at opensourceconnections.com> wrote:
>
> shipping_type.should be_include(Cart::SHIPPING_TYPE_REGULAR)
This is what I usually do; I agree the syntax of be_include looks odd, as is
true for some other predicates.
OTOH, it's hard to find a formulation that works well for all predicates.
For instance:
domain.should_valid doesn't look as good as domain.should be_valid
domain.should_include(x) looks better than domain.should be_include(x)
Rspec could support both, which means you could select the one that "looks"
right, I guess. That might lead to inconsistent usage. I can live with the
current approach as well, looks odd, but it's not a serious problem for me.
- Geoffrey
--
Geoffrey Wiseman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20071004/0a0f8fb6/attachment.html
More information about the rspec-users
mailing list