[rspec-users] .size.should === (4..5)

David Chelimsky dchelimsky at gmail.com
Wed Apr 28 14:01:51 EDT 2010


On Apr 28, 2010, at 12:53 PM, aidy lewis wrote:

> 	Hi,
> 
> 	I would like to test whether an array size is either of two integer obejects
> 
> 	mark_up_parser.sorted_xml.size.should === (4..5)
> 
> 	However I am recieiving an exception of:
> 
> 	expected: 4..5,
> 	got: 4 (using ===)
> 
> 	Do I need to write a custom matcher?

To phrase it like that, yes. You could to this now:

[4,5].should include(obj.size)

HTH,
David


More information about the rspec-users mailing list