如何进行自动测试 (ZenTest) 以查看我的命名空间内容?
我相信,自动测试应该将我的测试映射到一个类。当我有 class Foo
和 class FooTest
时,自动测试应该看到 FooTest
并说:“嘿,这个测试对应于单元 Foo
,因此我将在那里查找更改,并在发生更改时重新运行测试。”然而,这有效......
当我有 Foo::Bar
和 Foo::BarTest
时,自动测试似乎没有建立连接,并且每当我编辑 < code>Foo::Bar,自动测试不会重新运行 Foo::BarTest
我做错了什么吗?
编辑:文件结构可能会有所帮助。这是:
模块和类文件:
lib/foo.rb
lib/foo/bar.rb
lib/foo/baz.rb
测试文件:
test/unit/foo/bar.rb
test/unit/baz.rb
我认为自动测试能够在 Foo:: 之间建立连接Bar
和 Foo::BarTest
,但显然不是。
Autotest is supposed to map my tests to a class, I believe. When I have class Foo
and class FooTest
, autotest should see FooTest
and say, "Hey, this test corresponds to the unit Foo
, so I'll look for changes there and re-run tests when changes occur." And that works, however...
When I have Foo::Bar
and Foo::BarTest
, autotest doesn't seem to make the connection, and whenever I edit Foo::Bar
, autotest does not re-run Foo::BarTest
Am I doing something wrong?
EDIT: File structure might be helpful. Here it is:
Module and class files:
lib/foo.rb
lib/foo/bar.rb
lib/foo/baz.rb
Test files:
test/unit/foo/bar.rb
test/unit/baz.rb
I would think that autotest is able to make the connection between Foo::Bar
and Foo::BarTest
, but apparently it doesn't.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
显然
autotest -rails
不能很好地处理lib/*
中的命名空间内容。如果我在没有 Rails 模式的情况下强制进行简单的自动测试,则只需稍加调整,此设置就可以正常工作。点击此处了解更多信息。
Apparently
autotest -rails
doesn't play nicely with namespaced stuff inlib/*
. If I force just plain autotest without Rails mode, this setup works fine with a little tweaking.click here for more info.