Re: [rspec-users] Expectations on Class Methods

2007-11-27 Thread s.ross
On Nov 27, 2007, at 12:23 PM, Scott Taylor wrote: > Or, you could also do some sort of behaviour verification. What do > you expect this DatabaseMapper setup should do? Why is it in your > code? If you can answer these questions, then you can probably write > a test for it (but without stubbing

Re: [rspec-users] Expectations on Class Methods

2007-11-27 Thread Scott Taylor
On Nov 27, 2007, at 3:13 PM, s.ross wrote: > Sorry about the non-specific subject. Here's what I'm trying to do. I > have a method: > > DataMapper::Database.setup > > That I want to create an expectation on. I wrote: > > DataMapper::Database.should_receive(:setup).once.and_return > (connection_ha

[rspec-users] Expectations on Class Methods

2007-11-27 Thread s.ross
Sorry about the non-specific subject. Here's what I'm trying to do. I have a method: DataMapper::Database.setup That I want to create an expectation on. I wrote: DataMapper::Database.should_receive(:setup).once.and_return (connection_hash) The call to setup is invoked in the "Object" namespa