Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-22 Thread Lenny Marks
On Aug 22, 2012, at 1:38 PM, Lenny Marks wrote: > > On Aug 22, 2012, at 10:36 AM, David Chelimsky wrote: > >> On Wed, Aug 22, 2012 at 9:16 AM, J. B. Rainsberger wrote: >>> On Wed, Aug 22, 2012 at 10:07 AM, David Chelimsky >>> wrote: On Wed, Aug 22, 2012 at 7:52 AM, J. B. Rainsberge

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-22 Thread Lenny Marks
On Aug 22, 2012, at 10:36 AM, David Chelimsky wrote: > On Wed, Aug 22, 2012 at 9:16 AM, J. B. Rainsberger wrote: >> On Wed, Aug 22, 2012 at 10:07 AM, David Chelimsky >> wrote: >>> >>> On Wed, Aug 22, 2012 at 7:52 AM, J. B. Rainsberger wrote: On Tue, Aug 21, 2012 at 11:37 PM, Bas Vodde w

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-22 Thread J. B. Rainsberger
On Wed, Aug 22, 2012 at 11:36 AM, David Chelimsky wrote: > On Wed, Aug 22, 2012 at 9:16 AM, J. B. Rainsberger wrote: > > On Wed, Aug 22, 2012 at 10:07 AM, David Chelimsky > > wrote: > >> > >> On Wed, Aug 22, 2012 at 7:52 AM, J. B. Rainsberger > wrote: > >> > On Tue, Aug 21, 2012 at 11:37 PM, Ba

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-22 Thread David Chelimsky
On Wed, Aug 22, 2012 at 9:16 AM, J. B. Rainsberger wrote: > On Wed, Aug 22, 2012 at 10:07 AM, David Chelimsky > wrote: >> >> On Wed, Aug 22, 2012 at 7:52 AM, J. B. Rainsberger wrote: >> > On Tue, Aug 21, 2012 at 11:37 PM, Bas Vodde wrote: >> >> >> >> >> >> JB is right. >> >> >> >> Sometimes, fo

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-22 Thread J. B. Rainsberger
On Wed, Aug 22, 2012 at 10:07 AM, David Chelimsky wrote: > On Wed, Aug 22, 2012 at 7:52 AM, J. B. Rainsberger wrote: > > On Tue, Aug 21, 2012 at 11:37 PM, Bas Vodde wrote: > >> > >> > >> JB is right. > >> > >> Sometimes, for clarity, it is useful to add should_not, but for > >> functionality it

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-22 Thread David Chelimsky
On Wed, Aug 22, 2012 at 7:52 AM, J. B. Rainsberger wrote: > On Tue, Aug 21, 2012 at 11:37 PM, Bas Vodde wrote: >> >> >> JB is right. >> >> Sometimes, for clarity, it is useful to add should_not, but for >> functionality it is usually not needed. > > > I know JMock has never() for this people. Sho

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-22 Thread J. B. Rainsberger
On Tue, Aug 21, 2012 at 11:37 PM, Bas Vodde wrote: > > JB is right. > > Sometimes, for clarity, it is useful to add should_not, but for > functionality it is usually not needed. > I know JMock has never() for this people. Should RSpec-mocks have something like object.should_receive(:nothing). --

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-21 Thread Bas Vodde
JB is right. Sometimes, for clarity, it is useful to add should_not, but for functionality it is usually not needed. Bas On 22 Aug, 2012, at 4:12 AM, J. B. Rainsberger wrote: > On Tue, Aug 21, 2012 at 5:02 PM, Andrew Premdas wrote: > I want to write > > it "should ..." do > Client.shoul

Re: [rspec-users] How do I specify that a class does not receive any message

2012-08-21 Thread J. B. Rainsberger
On Tue, Aug 21, 2012 at 5:02 PM, Andrew Premdas wrote: > I want to write > > it "should ..." do > Client.should_not_receive(any_message) > # do something here that might do Client.xxx > end > I might be wrong, but if you use a mock object and set no expectations on it, it will expect no mess