3

遇到了自动测试问题,之前我通过从 ZenTest 4.1.4 降级到 4.1.3 解决了这个问题。

$ 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 Snow Leopard 系统上,当我$ 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

有人见过这个吗?


更新

过了一会儿,我正在开发一个不同的应用程序,我又遇到了同样的问题。这次降级 ZenTest 并没有解决它。

4

5 回答 5

17

我也为此苦苦挣扎。看起来 Rails 支持已从核心自动测试库中删除并移至它自己的 gem 中。gem install autotest-rails似乎让一切都为我工作。

于 2009-11-17T17:45:54.830 回答
3

我还可以确认,只需安装“autotest-rails”就可以为我解决问题,而无需将 ZenTest 降级到 4.0.0

于 2009-11-25T09:03:02.950 回答
1

我对 Shoulda 测试有同样的问题,降级到 4.0.0 解决了它。

sudo gem uninstall ZenTest

对删除二进制文件问题回答“是”

sudo gem install ZenTest --version '4.0.0'

于 2009-11-12T14:47:46.100 回答
0

我有一个类似的问题,我通过降级到 4.0.0 解决了。不幸的是,我没有时间调查为什么会发生这种情况,但我很想知道。

于 2009-10-15T23:59:56.460 回答
0

我遇到了同样的问题。安装 autotest-rails gem 为我解决了这个问题。我发现没有必要将 ZenTest 降级到 4.0.0(运行 4.1.4)。

于 2009-11-25T03:32:32.977 回答