Changes in rspec's trunk and autotest

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) 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

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

On Jan 11, 2008 9:45 AM, Tim G. [email protected] 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

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

On Jan 11, 2008 11:36 AM, Tim G. [email protected] 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

On Jan 11, 2008 9:52 AM, David C. [email protected] 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