Rick DeNatale wrote:
On Thu, Jul 23, 2009 at 8:41 PM, Ben Mabey wrote:
You can, IMO, use a "mock" like a stub and a "stub" like a
mock.. Take this for example:
describe "#some_method" do
it "delegates to some_obejct" do
some_object = stub('some object', :some_method => "foo")
my_object
On Thu, Jul 23, 2009 at 8:41 PM, Ben Mabey wrote:
> You can, IMO, use a "mock" like a stub and a "stub" like a
> mock.. Take this for example:
>
> describe "#some_method" do
> it "delegates to some_obejct" do
> some_object = stub('some object', :some_method => "foo")
> my_object = MyObject.new
Marcelo de Moraes Serpa wrote:
Thanks David and Ben for the comprehensive replies! I really appreciate it :)
These wikipedia articles helped me to understand on the more conceptual level:
http://en.wikipedia.org/wiki/Method_stub
http://en.wikipedia.org/wiki/Mock_object
So, if I understand it r
>In the context of rSpec/rSpec-Rails, however, the API makes it
>confusing, to be honest. Being able to create a Mock with
>Spec::Mocks:Mock with Spec::Mocks::ExampleMethods# confuses me.
Ops! In this paragraph I forgot to put the instance method name: It
should read Spec::Mocks::ExampleMethods#s
Thanks David and Ben for the comprehensive replies! I really appreciate it :)
These wikipedia articles helped me to understand on the more conceptual level:
http://en.wikipedia.org/wiki/Method_stub
http://en.wikipedia.org/wiki/Mock_object
So, if I understand it right -- Stub is for methods and M
On Jul 23, 7:41 pm, Ben Mabey wrote:
> Marcelo de Moraes Serpa wrote:> Hello list,
>
> > >From what I could see, the lines between mocks and stubs are subtle,
> > but the general idea I got is that mocks set expectations and stubs
> > are only dummy objects/method calls. What confused me though, i
Marcelo de Moraes Serpa wrote:
Hello list,
>From what I could see, the lines between mocks and stubs are subtle,
but the general idea I got is that mocks set expectations and stubs
are only dummy objects/method calls. What confused me though, is that
the stub() method is an alias for mock() in
S
On Thu, Jul 23, 2009 at 7:33 PM, David Chelimsky wrote:
> On Thu, Jul 23, 2009 at 6:39 PM, Marcelo de Moraes
> Serpa wrote:
>> Hello list,
>
> Oi Marcelo,
>
>>
>> >From what I could see, the lines between mocks and stubs are subtle,
>> but the general idea I got is that mocks set expectations and s
On Thu, Jul 23, 2009 at 6:39 PM, Marcelo de Moraes
Serpa wrote:
> Hello list,
Oi Marcelo,
>
> >From what I could see, the lines between mocks and stubs are subtle,
> but the general idea I got is that mocks set expectations and stubs
> are only dummy objects/method calls. What confused me though,
Hello list,
>From what I could see, the lines between mocks and stubs are subtle,
but the general idea I got is that mocks set expectations and stubs
are only dummy objects/method calls. What confused me though, is that
the stub() method is an alias for mock() in
Spec::Mocks::ExampleMethods. So a
10 matches
Mail list logo