Re: [rspec-users] modelling roles and responsibilities

2011-12-09 Thread Nikolay Sturm
* 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

Re: [rspec-users] modelling roles and responsibilities

2011-12-07 Thread Nikolay Sturm
* 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

[rspec-users] modelling roles and responsibilities

2011-12-06 Thread Nikolay Sturm
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

Re: [rspec-users] Skipping slow specs in Guard but running them from that file

2011-08-30 Thread Nikolay Sturm
* 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

Re: [rspec-users] Skipping slow specs in Guard but running them from that file

2011-08-29 Thread Nikolay Sturm
* 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

Re: [rspec-users] mock weirdness

2011-08-22 Thread Nikolay Sturm
* 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

[rspec-users] mock weirdness

2011-08-22 Thread Nikolay Sturm
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.