# Changes in rspec's trunk and autotest

**URL:** <https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682>\
**Category:** RSpec\
**Created:** [January 11, 2008, 4:29am UTC](https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682 "2008-01-11T04:29:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [January 11, 2008, 4:29am UTC](https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682/1 "2008-01-11T04:29:39Z")

</div>

This applies to anyone using rspec’s trunk from \>= 3220 with ZenTest \<=  
3.7.2.

Anyone else, feel free to move on…

The next release of ZenTest, coming soon, includes some changes that  
improve the relationship between Autotest, it’s subclasses (like those  
in rspec) and .autotest, the file that you can use to plug into  
autotest’s hooks to extend/modify it’s behaviour.

Previously, subclasses got loaded after .autotest, causing changes to  
test\_mappings and exceptions to be overridden. With the next release,  
the load order is corrected so anything in .autotest will be processed  
after Autotest::Rspec or Autotest::RailsRspec is loaded.

I committed changes to RSpec’s trunk r3220 that will break your  
current autotest configuration. If it does, you can apply this patch  
([Parked at Loopia](http://pastie.caboo.se/138024)) to your local copy of ZenTest  
(assuming you’re up to 3.7.2) and all should be right with the world.

Again - this is ONLY for people who are following RSpec’s trunk and  
using autotest.

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [January 11, 2008, 4:45pm UTC](https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682/2 "2008-01-11T16:45:45Z")

</div>

since i’m on rspec trunk, I applied your patch and ran into a little  
issue. All my specs still run but it seems to be looking at and  
“attempting” all of my hidden files and directories (and some other  
stuff too?):  
  
Dunno! Capfile  
Dunno! app/helpers/.svn/format  
Dunno! app/views/sales/.svn/text-base/edit.html.erb.svn-base  
Dunno! tmp/sessions/.svn/dir-prop-base  
Dunno! app/helpers/.svn/README.txt  
Dunno! app/helpers/.svn/wcprops/stores\_helper.rb.svn-work  
Dunno! app/views/users/.svn/entries  
Dunno! app/.DS\_Store  
Dunno! app/controllers/.svn/prop-base/users\_controller.rb.svn-base  
Dunno! app/views/markets/.svn/wcprops/index.html.erb.svn-work  
Dunno! spec/views/markets/.svn/text-base/new.html.erb\_spec.rb.svn-base  
Dunno! app/views/stores/.svn/wcprops/index.html.erb.svn-work  
Dunno! tmp/cache/.svn/format  
Dunno! app/views/districts/.svn/dir-wcprops  
Dunno! .svn/wcprops/Capfile.svn-work  
Dunno! spec/views/markets/.svn/wcprops/edit.html.erb\_spec.rb.svn-work

Like I said, my specs still run, so things aren’t broken per se but  
this behaviour doesn’t really seem right to me. Is this happening for  
anyone else or am I some sort of edge case?

take care,  
tim

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [January 11, 2008, 4:53pm UTC](https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682/3 "2008-01-11T16:53:24Z")

</div>

On Jan 11, 2008 9:45 AM, Tim G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Dunno! app/helpers/.svn/wcprops/stores\_helper.rb.svn-work  
>   
> This is a new thing autotest is doing. That’s just a listing of files  
> in the current directory or below that autotest doesn’t see mapped in  
> some way.

If you set $VERBOSE to false in .autotest, they won’t appear.

The other thing you can do, which I think is the better approach, is  
to add an initialize hook in .autotest. Here’s mine:

Autotest.add\_hook :initialize do |at|  
%w{.hg .git stories tmtags Rakefile Capfile README spec/spec.opts  
spec/rcov.opts}.each {|exception|at.add\_exception(exception)}  
end

The cool thing is this actually works now. Before, these exceptions  
got squashed by autotest subclasses (like autotest/rspec).

HTH,  
David

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [January 11, 2008, 6:37pm UTC](https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682/4 "2008-01-11T18:37:07Z")

</div>

very cool.

Funny enough, I never knew this functionality even existed - it was  
just getting clobbered all this time.  
Now I see ~10 files that actually need specs, which were totally  
getting missed before!

thanks,  
tim

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [January 11, 2008, 6:39pm UTC](https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682/5 "2008-01-11T18:39:28Z")

</div>

On Jan 11, 2008 11:36 AM, Tim G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> very cool.
> 
> Funny enough, I never knew this functionality even existed - it was  
> just getting clobbered all this time.

It’s only in the last release or two.

> Now I see ~10 files that actually need specs, which were totally  
> getting missed before!

Nice benefit.

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![crucoba](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e8c25b/32.png) [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Post date:** [January 11, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/changes-in-rspecs-trunk-and-autotest/125682/6 "2008-01-11T16:56:57Z")

</div>

On Jan 11, 2008 9:52 AM, David C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Dunno! app/helpers/.svn/README.txt  
> > Dunno! spec/views/markets/.svn/wcprops/edit.html.erb\_spec.rb.svn-work
> 
> Autotest.add\_hook :initialize do |at|  
> %w{.hg .git stories tmtags Rakefile Capfile README spec/spec.opts  
> spec/rcov.opts}.each {|exception|at.add\_exception(exception)}  
> end

BTW - you can have this hook in both ~/.autotest and .autotest in the  
project directory. The hook is addative, so you can have the common  
things in ~/.autotest and any project specific exceptions in the  
project’s .autotest.

Additionally, there are actually three methods related to exceptions:

add\_exception  
remove\_exception  
clear\_exceptions

The load order is:

the autotest class  
~/.autotest  
./.autotest

So you get a LOT of control at various levels of granularity.

Very cool stuff!

Cheers,  
David
