[rspec-users] Checking for Range

David Chelimsky dchelimsky at gmail.com
Sun May 27 15:03:40 EDT 2007


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)

Cheers,
David


More information about the rspec-users mailing list