🕷 zenspider.com

by ryan davis



sitemap
Looking for the Ruby Quickref?

using ZenTest on rails

Published 2006-08-03 @ 14:48

Tagged zentest, rails

Currently to run zentest on rails you have to jump through some extra hoops. This is because you need to require config/environment to get the magic const loader. BUT, because that maps ClassName to class_name.rb, you also have to load app/controllersapplication.rb (because the class inside is ApplicationController, not Application):

ruby -I.:lib:test -r ./config/environment.rb -r app/controllers/application.rb \
  -S zentest -r app/controllers/groups_controller.rb \
  test/functional/groups_controller_test.rb

I’ve got some unreleased changes that should make it as easy as:

zentest -r app/controllers/groups_controller.rb \
  test/functional/groups_controller_test.rb