ZenTest 自动测试不运行测试

发布于 2024-08-08 03:07:27 字数 3445 浏览 7 评论 0原文

我之前遇到过自动测试问题,我通过从 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 并没有解决问题。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

动听の歌 2024-08-15 03:07:27

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

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.

燕归巢 2024-08-15 03:07:27

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

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

窝囊感情。 2024-08-15 03:07:27

我在 Shoulda 测试中遇到了同样的问题,降级到 4.0.0 解决了它。

sudo gem uninstall ZenTest

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

sudo gem install ZenTest --version '4.0.0'

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'

蓝海 2024-08-15 03:07:27

我遇到了类似的问题,我通过降级到 4.0.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.

紧拥背影 2024-08-15 03:07:27

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

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文