Let''s say I change a method in one of my models in a Rails app. I hit save: autospec kicks in and starts specing. But I haven''t yet edited my spec(s) to the new method name so the specs will obviously fail, but I already know that. So I edit my specs. Autospec will run a second time (or even more if more than one spec file is changed). But I haven''t yet edited my controller(s) to reflect the new change(s), so I edit more files and save, therefore Autospec will run again. In such case (which happens often), autospec has been running a few times for nothing. Would it be possible to implement a sort of timeout (like 10") to let us make additional changes to other files before autospec starts his job? It''s pretty annoying to have growl display plenty error messages as we already know specs will fail. -- Posted via http://www.ruby-forum.com/.
On 9 Nov 2008, at 17:05, Fernando Perez wrote:> Let''s say I change a method in one of my models in a Rails app. > > I hit save: autospec kicks in and starts specing. > > But I haven''t yet edited my spec(s) to the new method name so the > specs > will obviously fail, but I already know that. So I edit my specs. > Autospec will run a second time (or even more if more than one spec > file > is changed). > > But I haven''t yet edited my controller(s) to reflect the new > change(s), > so I edit more files and save, therefore Autospec will run again. > > In such case (which happens often), autospec has been running a few > times for nothing. Would it be possible to implement a sort of timeout > (like 10") to let us make additional changes to other files before > autospec starts his job? It''s pretty annoying to have growl display > plenty error messages as we already know specs will fail.Personally, I draw great comfort from those error messages. http://www.google.co.uk/search?q=red+green+refactor cheers, Matt
Fernando Perez wrote:> Let''s say I change a method in one of my models in a Rails app. > > I hit save: autospec kicks in and starts specing. > > But I haven''t yet edited my spec(s) to the new method name so the specs > will obviously fail, but I already know that. So I edit my specs. > Autospec will run a second time (or even more if more than one spec file > is changed). > > But I haven''t yet edited my controller(s) to reflect the new change(s), > so I edit more files and save, therefore Autospec will run again. > > In such case (which happens often), autospec has been running a few > times for nothing. Would it be possible to implement a sort of timeout > (like 10") to let us make additional changes to other files before > autospec starts his job? It''s pretty annoying to have growl display > plenty error messages as we already know specs will fail. >The problem is I would want feedback asap on a fail. The faster I get feedback the earlier I realize I''ve broken something and the easier it will be to localise the error. I think getting error messages I already know about is easily worth the sacrifice of this. -- Joseph Wilk http://blog.josephwilk.net
On Nov 09, 2008, at 5:05 pm, Fernando Perez wrote:> Let''s say I change a method in one of my models in a Rails app. > > I hit save: autospec kicks in and starts specing. > > But I haven''t yet edited my spec(s) to the new method name so the > specs > will obviously fail, but I already know that. So I edit my specs. > Autospec will run a second time (or even more if more than one spec > file > is changed).Why are you routinely changing the code without updating the specs in advance? Ashley -- http://www.patchspace.co.uk/ http://aviewfromafar.net/
> Why are you routinely changing the code without updating the specs in > advance? > > AshleyThat''s not the point of my question. Anyway I have just discovered TextMate has a "save-all" keyboard shortcut that works exactly as I want it. Now autospec runs only once. Sweet :-) -- Posted via http://www.ruby-forum.com/.
On Nov 09, 2008, at 5:58 pm, Fernando Perez wrote:>> Why are you routinely changing the code without updating the specs in >> advance? > > That''s not the point of my question.I learnt early on when I joined this list, that whenever I ask a question of the form "When I do XXX, I get weird/undesirable behaviour, how do I avoid it?", 90%+ of the time the answer is of the form "Don''t do XXX."*. What you were describing sounded like something you shouldn''t be doing often enough to worry about it''s consequences, but I wanted to rule that out first... Ashley * Probably half the emails I write to rspec-users I delete without sending, because by the time I''ve explained the problem in enough detail, I realise I''ve answered my own question -- http://www.patchspace.co.uk/ http://aviewfromafar.net/
On 9 Nov 2008, at 19:07, Ashley Moran wrote:> * Probably half the emails I write to rspec-users I delete without > sending, because by the time I''ve explained the problem in enough > detail, I realise I''ve answered my own questionTechnical term is "Teddy Bear Programming" :) C --- Caius Durling caius at caius.name +44 (0) 7960 268 100 http://caius.name/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081109/b6e362d6/attachment.html>
On Nov 09, 2008, at 7:35 pm, Caius Durling wrote:>> * Probably half the emails I write to rspec-users I delete without >> sending, because by the time I''ve explained the problem in enough >> detail, I realise I''ve answered my own question > > > Technical term is "Teddy Bear Programming" :)So it is :) http://headrush.typepad.com/creating_passionate_users/2005/01/rubberducking_a.html And it''s known as rubber-ducking too. There''s a definite Sesame Street vibe here. From now on all my programming sessions are going to look like this: http://uk.youtube.com/watch?v=B8IfCSnYPYo And I''ll have NO bugs! Ashley -- http://www.patchspace.co.uk/ http://aviewfromafar.net/