[rspec-users] Checking for Range

David Chelimsky dchelimsky at gmail.com
Sun May 27 15:06:01 EDT 2007


On 5/27/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 5/27/07, Andrew WC Brown <omen.king at gmail.com> wrote:
> > how would you check for a range using rspec?
> >
> > person.password.range.should == Range.new(5..40) <- this doesn't work
>
> The correct ruby syntax is Range.new(5, 40). So this should work:
>
> person.password.range.should == Range.new(5, 40)

OR ....

person.password.range.should == (5..40) #shortcut for Range.new(5, 40)


>
> Cheers,
> David
>


More information about the rspec-users mailing list