.html.erb files and autotest

When I work with a .html.erb file, the autotest rspec on rails stuff
doesn’t
understand the file to map it to the right test. I wanted to submit a
patch
for this, but I’m unsure where the specs would be to update. I found the
necessary mapping in rspec_autotest.rb, but I can’t find any specs
anywhere.
Help?

I just need to have
/app/views/coupon/index.html.erb to map to
/spec/views/coupon/index_spec.rb

-Corey

On Jan 13, 2008 3:51 PM, Corey H. [email protected] wrote:

When I work with a .html.erb file, the autotest rspec on rails stuff doesn’t
understand the file to map it to the right test. I wanted to submit a patch
for this, but I’m unsure where the specs would be to update. I found the
necessary mapping in rspec_autotest.rb, but I can’t find any specs anywhere.
Help?

I just need to have
/app/views/coupon/index.html.erb to map to /spec/views/coupon/index_spec.rb

The right spec is index.html.erb_spec.rb - that’s what the mapping is.
If you want to change the mapping locally, you can if you’re using
rspec’s trunk and a patched version of ZenTest (see
http://rubyforge.org/pipermail/rspec-users/2008-January/005321.html).

Cheers,
David

Okay, thanks.

I get this

Dunno! app/views/coupon/index.html.erb

Set $VERBOSE=false in your .autotest file in your home directory.

Nathan S.
[email protected]
rspec 1.1
rspec_on_rails 1.1
rails 2.0.2

Awesome! That worked perfectly, Nathan! Thanks.

-Corey

On Jan 13, 2008 9:14 PM, Corey H. [email protected] wrote:

Awesome! That worked perfectly, Nathan! Thanks.

There will soon (like in the next day or two I think) be a ZenTest
release which will make setting $VERBOSE obsolete. By default you
won’t get the Dunno messages, but you can choose to get them by
running autotest in verbose mode:

autotest -v

The benefit of doing that is it spots files that you may not have
spec’d that you want spec’d. On the flip side you end up with a bunch
of noise but you can eliminate that w/ the :initialize hook:

Autotest.add_hook :initialize do |at|
at.add_exception ‘some_file_i_want_ignored’
end

That goes in .autotest in the root of your project, where you type the
autotest command.

HTH,
David

Awesome David, yeah I was quite surprised that verbose was on by
default in 3.7.2.

Nathan S.
[email protected]
rspec 1.1
rspec_on_rails 1.1
rails 2.0.2

The benefit of doing that is it spots files that you may not have
spec’d that you want spec’d. On the flip side you end up with a bunch
of noise but you can eliminate that w/ the :initialize hook:

Autotest.add_hook :initialize do |at|
at.add_exception ‘some_file_i_want_ignored’
end

That goes in .autotest in the root of your project, where you type the
autotest command.

I’m probably too much of a Ruby coder, but an Exception is an existing
Ruby class. add_exception seems strange to me.

How about at.except, at.ignore_file or at.ignore ?
I like the last one best.

Bye,
Kero.

On Jan 14, 2008 6:46 PM, Kero van Gelder [email protected]
wrote:

I’m probably too much of a Ruby coder, but an Exception is an existing
Ruby class. add_exception seems strange to me.

How about at.except, at.ignore_file or at.ignore ?
I like the last one best.

Good point. Wrong list. That’s autotest. Try submitting a request in
the ZenTest tracer:

http://rubyforge.org/projects/zentest

Cheers,
David

Okay. Thanks for the help, guys. I’m back on track!