* David Chelimsky [2011-12-07]:
> Nikolay - just because they're shareable doesn't mean they have to be
> shared :) As Pat suggests, you can use them to specify a subset of a
> single object's API. That said, one goal of thinking of roles is code
> that is easy to extend thanks to polymorphism. You
* David Chelimsky [2011-12-07]:
> > reading "Growing Object-Oriented Software, guided by tests", I came
> > across the distinction of class, role and responsibility.
> >
> > While classes are classes and responsibilities could be mapped to public
> > methods, I wonder how to specify roles in my spe
Hi,
reading "Growing Object-Oriented Software, guided by tests", I came
across the distinction of class, role and responsibility.
While classes are classes and responsibilities could be mapped to public
methods, I wonder how to specify roles in my specs. Does anyone have
experiences with this?
c
* Ash Moran [2011-08-30]:
> I never thought of that! Yes, that could also work, probably better in
> fact. It just involves running multiple Guard processes, although
> there's Terminitor[1] for that!
A single guard process is enough, it will start all guards defined in
your Guardfile.
cheers,
N
* Ash Moran [2011-08-30]:
> I'm trying to optimise my spec run time. I have 123 examples so far,
> which run in ~4.2 seconds on average. But 116 of those will run in
> ~0.18 seconds. So, obviously, I only want to run the slow ones when I
> change that code.
I have a similar situation with the slow
* David Chelimsky [2011-08-22]:
> This means that you need to explicitly stub the load method to do what
> you're trying to do:
>
> let(:bar) { mock(Bar, :load => nil).as_null_object }
Thanks for the explanation, David. I wasn't sure whether or not this was
accepted behaviour, I would have expec
Hi,
I have a strange problem with mocking an object that has a method called
'load'. With Rails 2.3 and rspec-rails 1.3 I could do sth like this:
describe Foo do
let(:bar) { mock(Bar).as_null_object }
before(:each) do
Bar.stub(:new).and_return(bar)
end
it 'does something' do
Foo.