Forum: RSpec A smarter autospec?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fernando P. (Guest)
on 2008-11-09 19:05
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.
Matt W. (Guest)
on 2008-11-09 19:15
(Received via mailing list)
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
Joseph W. (Guest)
on 2008-11-09 19:18
(Received via mailing list)
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
Ashley M. (Guest)
on 2008-11-09 19:32
(Received via mailing list)
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/
http://aviewfromafar.net/
Fernando P. (Guest)
on 2008-11-09 19:58
> 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 :-)
Ashley M. (Guest)
on 2008-11-09 21:12
(Received via mailing list)
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/
http://aviewfromafar.net/
Caius D. (Guest)
on 2008-11-09 21:39
(Received via mailing list)
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" :)

C
---
Caius D.
removed_email_address@domain.invalid
+44 (0) 7960 268 100
http://caius.name/
Ashley M. (Guest)
on 2008-11-09 22:09
(Received via mailing list)
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" :)

So it is :)

http://headrush.typepad.com/creating_passionate_us...

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/
This topic is locked and can not be replied to.