[rspec-users] Using Predicates to look at an array..
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.
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rspec-users