[rspec-users] Expectation ordering

Ashley Moran ashley.moran at patchspace.co.uk
Tue Oct 7 10:40:30 EDT 2008


On 7 Oct 2008, at 15:15, David Chelimsky wrote:

> As far as I know this form of expectation ordering was never
> supported. If you've seen documentation that suggests it should be,
> please point me to it so I can resolve the discrepancy.

Aslak told me himself... on this list :o)


> Ordering in rspec mocks is managed with the #ordered method:
>
> @socket.should_receive(:write).ordered
> @socket.should_receive(:read).ordered
> @socket.should_receive(:close).ordered

I forgot about that.  When I asked on the list before it was because I  
needed a way to do inter-mock ordering.  Thanks for the link, it  
solved the problem in the example I gave.  Unfortunately looks like  
I've lost the ability to do this:

       it "should migrate the database (after initialising it)" do
         DataMapper.should_receive(:setup) do
           Database::Migrator.should_receive(:migrate_up!)
         end
         @server.start
       end

Maybe I was the only person taking advantage of this?

Ashley

-- 
http://www.patchspace.co.uk/
http://aviewfromafar.net/





More information about the rspec-users mailing list