A smarter autospec?


#1

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.


#2

On 9 Nov 2008, at 17:05, Fernando P. wrote:

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


#3

Fernando P. wrote:

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 W.
http://blog.josephwilk.net


#4

On Nov 09, 2008, at 5:05 pm, Fernando P. 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/


#5

On Nov 09, 2008, at 5:58 pm, Fernando P. 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/


#6

On 9 Nov 2008, at 19:07, Ashley M. 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” :slight_smile:

C

Caius D.
removed_email_address@domain.invalid
+44 (0) 7960 268 100
http://caius.name/


#7

Why are you routinely changing the code without updating the specs in
advance?

Ashley
That’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 :slight_smile:


#8

On Nov 09, 2008, at 7:35 pm, Caius D. 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” :slight_smile:

So it is :slight_smile:

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/