2009-10-15 201 views
3

我已經problems with autotest before我在降級從ZenTest 4.1.4 4.1.3解決。ZenTest自動測試不運行測試,

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

目前我發現我的Mac OS 10.6.1雪豹系統,當我跑在我的項目$ autotest沒有運行測試,我得到這個輸出上...​​

$ 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 

嘗試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 

如果我運行$ rake test它工作正常。運行所有測試...

$ 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 

任何人看到這個?


UPDATE

這是一個過了一會兒,我的工作在不同的應用程序,我又遇到了同樣的問題。這次降級ZenTest沒有解決它。

+0

是否使用測試::單位或Rspec的?有一些配置需要告訴autotest加載'spec'文件。 你的目錄的佈局是什麼? Autotest希望在某些地方找到這些文件,如果它們在其他地方,它們將不會運行它們。 – Emily 2009-10-15 20:43:35

+0

測試::單位與Shoulda。測試文件位於project_root/test的預期位置 - rake測試正常工作。此外,自動測試還可以在其他系統上使用此項目。 – Ethan 2009-10-15 20:51:09

+0

有通過堆棧溢出使用兩種標籤:自動測試和zentest - 可誰的人有足夠的權限制定出他們是否是同義詞和做些什麼呢? – 2011-05-11 23:53:12

回答

0

我有一個類似的問題,我將降級到4.0.0解決。不幸的是,我沒有時間調查爲什麼發生這種情況,但我有興趣知道。

+0

謝謝,我會嘗試進一步降級。 – Ethan 2009-10-16 02:06:51

1

我曾與早該測試同樣的問題,降級到4.0.0解決了這個問題。

sudo gem uninstall ZenTest

回答是刪除二進制質疑

sudo gem install ZenTest --version '4.0.0'

+0

這爲我工作,但你也可以執行以下操作,以便能夠使用最新的ZenTest:寶石卸載ZenTest &&創業板安裝ZenTest自動測試,自動測試的咆哮 - fsevent自動測試護欄 – jschorr 2011-01-10 15:39:01

17

我這個掙扎過。看起來Rails支持已從核心自動測試庫中移除,並轉移到它自己的gem中。 gem install autotest-rails似乎讓一切爲我工作。

+0

這並沒有爲我工作。 – Ethan 2011-05-11 23:13:31

0

我經歷了同樣的問題。安裝autotest-rails gem爲我解決了它。我沒有發現有必要將ZenTest降級到4.0.0(運行4.1.4)。

3

我也可以證實,只要安裝「自動測試護欄」解決了這個問題對我來說,無需降級ZenTest到4.0.0