Hi,

I'm new to Merb, just starting my first app tonight.  I'd like to  
write a spec along these lines:

   describe Items, "#new" do
     before(:each) do
       @item = mock(Item)
       Item.stub!(:new).and_return(@item)
     end
     it "should display a new Item" do
       <controller>.should_receive(:display).with(@item)
       dispatch_to(Items, :index)
     end
   end

to describe this:

   class Items < Application
     def new
       @item = Item.new
       display @item
     end
   end

But the Merb example groups don't appear to provide access to the  
controller.  (Maybe it doesn't exist at this point anyway?)  The  
closest I can find is on the Slapp page[1], but the approach their  
involves a bit too much voodoo magic for my liking (perhaps just my  
opinion because I'm not yet brave enough to go poking around the Merb  
spec internals).

Can anyone show me the best/a good way to write a spec for this?  Any  
help for a Merb n00b much appreciated.

Cheers
Ashley

[1] http://www.socialface.com/slapp/

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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to