Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-27 Thread Matthew Van Horn
On Apr 27, 2011, at 6:40 AM, David Chelimsky wrote: > > On Apr 26, 2011, at 5:39 PM, Matthew Van Horn wrote: > >> >> On Apr 26, 2011, at 4:02 PM, Rodrigo Rosenfeld Rosas wrote: >> >>> Ok, now I understand what is your issue. >>> >> class Foo >> end >> >> class Bar >> d

Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-27 Thread David Chelimsky
On Apr 26, 2011, at 5:39 PM, Matthew Van Horn wrote: > > On Apr 26, 2011, at 4:02 PM, Rodrigo Rosenfeld Rosas wrote: > >> Ok, now I understand what is your issue. >> > class Foo > end > > class Bar > def self.my_foo > @my_foo ||= Foo.new > end > def s

Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-26 Thread Matthew Van Horn
On Apr 26, 2011, at 4:02 PM, Rodrigo Rosenfeld Rosas wrote: > Ok, now I understand what is your issue. > class Foo end class Bar def self.my_foo @my_foo ||= Foo.new end def self.perform my_foo.do_something end end

Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-26 Thread Rodrigo Rosenfeld Rosas
Ok, now I understand what is your issue. class Fooend class Bar  def self.my_foo    @my_foo ||= Foo.new  end  def self.perform     my_foo.do_something  endend describe Foo do   before(:each) do    @stupid_mock = double('wtf')    Foo.stub(:new => @stupid_mock)  endit "passes here" do     @stupi

Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-26 Thread Matthew Van Horn
On Apr 25, 2011, at 11:30 PM, Rodrigo Rosenfeld Rosas wrote: > Em 25-04-2011 14:58, Matthew Van Horn escreveu: >> >> >> On Apr 25, 2011, at 1:36 PM, Matthew Van Horn wrote: >> >>> I've run into some strange behavior in porting my specs from rspec to >>> rspec2. >>> I am wondering if I am doin

Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-25 Thread Rodrigo Rosenfeld Rosas
Em 25-04-2011 14:58, Matthew Van Horn escreveu: On Apr 25, 2011, at 1:36 PM, Matthew Van Horn wrote: I've run into some strange behavior in porting my specs from rspec to rspec2. I am wondering if I am doing something wrong, or if I've misunderstood something, or if this is some kind of bug.

Re: [rspec-users] Mocking/Stubbing behavior question

2011-04-25 Thread Matthew Van Horn
On Apr 25, 2011, at 1:36 PM, Matthew Van Horn wrote: > I've run into some strange behavior in porting my specs from rspec to rspec2. > I am wondering if I am doing something wrong, or if I've misunderstood > something, or if this is some kind of bug. > > Look at the specs below: a > Both exampl

[rspec-users] Mocking/Stubbing behavior question

2011-04-25 Thread Matthew Van Horn
I've run into some strange behavior in porting my specs from rspec to rspec2. I am wondering if I am doing something wrong, or if I've misunderstood something, or if this is some kind of bug. Look at the specs below: a Both examples will pass if run singly. The second one will fail if I run both