On May 23, 2008, at 4:56 AM, Doug Livesey wrote:
Hi -- is there an equivalent to the anything() method to use with Hash
parameters?
So that the following call:
Model.find( :all, :conditions => "name LIKE '%rt%'", :order => 'name'
)
Could have the two following successful examples:
Model.should_receive( :find ).with( :all, { :conditions => "name LIKE
'%rt%", anything } )
Model.should_receive( :find ).with( :all, { anything, :order =>
'name'
} )
If you're using the latest from github:
Model.should_receive(:find).with(:all, hash_including(:order => 'name'))
This only verifies the specified key/value pairs and ignores
everything else.
Cheers,
David
If anyone knew a way of generating that sort of behaviour, I'd be
*very*
grateful!
Cheers,
Doug.
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users