Thanks Ivo, I was getting a bit confused with the stubs, thanks for the explanation.
Jamie On 19/04/2008, Ivo Dancet <[EMAIL PROTECTED]> wrote: > Hi > > The 'loadavg' method is an instance method of 'whm', so the test > should be: > > @whm = mock_model(Whm::Client) > Whm::Client.stub!(:new).and_return(@whm) # make the new method to > return a mock object > @whm.stub!(:loadavg).and_return(3) # 3 is the dummy loadavg, maybe you > can change it in something more meaningfull > > For now, there is no real reason to put this into the test itself. I > think I would put this code in the before part. > > Regards > Ivo _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users