3

I've had problems with autotest before which I resolved by downgrading from ZenTest 4.1.4 to 4.1.3.

$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
$ rails -v
Rails 2.3.4

Currently I'm finding that on my Mac OS 10.6.1 Snow Leopard system, when I run $ autotest in my project no tests are run and I get this output...

$ autotest
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I.:lib:test -rubygems -e "%w[test/unit test/test_helper.rb].each { |f| require f }" | unit_diff -u
Loaded suite -e
Started

Finished in 0.000225 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

Try control-C...

^CInterrupt a second time to quit
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I.:lib:test -rubygems -e "%w[test/unit test/test_helper.rb].each { |f| require f }" | unit_diff -u
Loaded suite -e
Started

Finished in 0.000205 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

If I run $ rake test it works fine. Runs all tests...

$ rake test
(in /Users/abc/project/abc/contactdb)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib:test" "/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/address_list_membership_test.rb" "test/unit/address_test.rb" "test/unit/application_log_message_test.rb" "test/unit/asset_test.rb" "test/unit/asset_type_test.rb" "test/unit/attribute_value_test.rb" "test/unit/contact_test.rb" "test/unit/financial_document_test.rb" "test/unit/helpers/application_helper_test.rb" "test/unit/list_test.rb" "test/unit/log_entry_test.rb" "test/unit/organization_test.rb" "test/unit/phone_number_test.rb" "test/unit/role_test.rb" "test/unit/user_test.rb" 
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
...........................................
Finished in 0.334388 seconds.

43 tests, 50 assertions, 0 failures, 0 errors
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib:test" "/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/addresses_controller_test.rb" "test/functional/application_controller_test.rb" "test/functional/application_log_messages_controller_test.rb" "test/functional/contacts_controller_test.rb" "test/functional/financial_documents_controller_test.rb" "test/functional/lists_controller_test.rb" "test/functional/log_entries_controller_test.rb" "test/functional/organizations_controller_test.rb" "test/functional/phone_numbers_controller_test.rb" "test/functional/sessions_controller_test.rb" "test/functional/users_controller_test.rb" 
Loaded suite /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
.................................................................................................................................................................................................
Finished in 5.636152 seconds.

193 tests, 206 assertions, 0 failures, 0 errors
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I"lib:test" "/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb"  
Loaded suite /usr/bin/rake
Started

Finished in 0.000253 seconds.

0 tests, 0 assertions, 0 failures, 0 errors

Anyone seen this?


UPDATE

It's a while later and I'm working on a different app and I've run into the same problem again. This time downgrading ZenTest didn't resolve it.

Community
  • 1
  • 1
Ethan
  • 57,819
  • 63
  • 187
  • 237
  • Are you using Test::Unit or Rspec? There's configuration required to tell autotest to load `spec` files. What's the layout of your directory? Autotest expects to find the files in certain places and won't run them if they're elsewhere. – Emily Oct 15 '09 at 20:43
  • Test::Unit with Shoulda. The test files are in the expected locations in project_root/test -- rake test works fine. Also, autotest works with this project on other systems. – Ethan Oct 15 '09 at 20:51
  • There's two tags used by Stack Overflow: autotest and zentest - can someone who has sufficient privileges work out whether they're synonyms and do something about it? – Andrew Grimm May 11 '11 at 23:53

5 Answers5

17

I struggled with this too. It looks like Rails support was removed from the core autotest library and moved into it's own gem. gem install autotest-rails seems to get everything working for me.

Kenny
  • 794
  • 5
  • 7
3

I can also confirm that simply installing 'autotest-rails' solved the problem for me without having to downgrade ZenTest to 4.0.0

Sam Figueroa
  • 2,301
  • 22
  • 21
1

I had the same problem with Shoulda tests, downgrade to 4.0.0 solved it.

sudo gem uninstall ZenTest

answer yes to the remove binaries question

sudo gem install ZenTest --version '4.0.0'

  • This worked for me but you can also do the following in order to be able to use the latest ZenTest: gem uninstall ZenTest && gem install ZenTest autotest-growl autotest-fsevent autotest-rails – jschorr Jan 10 '11 at 15:39
0

I had a similar problem which I resolved by downgrading to 4.0.0. Unfortunately I didn't have time to investigate why this happened in the first place, but I would be interested to know.

Olly
  • 7,732
  • 10
  • 54
  • 63
0

I experienced the same problem. Installing the autotest-rails gem solved it for me. I didn't find it necessary to downgrade ZenTest to 4.0.0 (running 4.1.4).

insane.dreamer
  • 2,052
  • 1
  • 17
  • 21