Rails 中的自动测试如何运行集成测试?
我在 .autotest 中有这个:
Autotest.add_hook :initialize do |autotest|
autotest.add_mapping(/^spec\/requests\/.*_spec\.rb$/) do
autotest.files_matching(/^spec\/requests\/.*_spec\.rb$/)
end
end
当我运行自动测试时,它最初运行所有单元和集成(\requests)测试。然后,当我更改文件时,它仅运行其单元测试,而不运行集成。
有什么想法吗?
I have this in .autotest:
Autotest.add_hook :initialize do |autotest|
autotest.add_mapping(/^spec\/requests\/.*_spec\.rb$/) do
autotest.files_matching(/^spec\/requests\/.*_spec\.rb$/)
end
end
when I run autotest it initially runs all unit and integration (\requests) tests. Then when I change a file it runs only its unit tests and not the integrations.
any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要安装并需要 fsevent gem。
所以:
或者只是gem安装,具体取决于您是否使用RVM
然后在您的.autotest中输入以下要求:
您还应该通过进入正在运行自动测试的窗口/选项卡并按ctrl键来确保它没有运行整个测试套件-c 一次。这将重新启动您的自动测试并运行自动测试涵盖的所有测试。我发现自动测试首先运行最新的规范,然后运行所有测试。
希望这有帮助!
You need to install and require the fsevent gem.
So:
Or just gem install depending if you are using RVM
Then in your .autotest put the following require:
You should also insure that it isn't running the whole test suite by going into the window/tab that is running autotest and hit ctrl-c once. That will restart your autotest and run all the tests that autotest is covering. I have found that autotest runs the most recent spec first then all the tests.
Hope this helps!