如何配置自动测试以在 Mac OS X Lion 上运行
我正在学习 Michael Hartl 的 Rails 教程,他在第 5 章中说应该配置 Mac OS X 来运行自动测试。他为 OS X 提供的代码是:
Autotest.add_hook :initialize do |autotest|
autotest.add_mapping(/^spec\/requests\/.*_spec\.rb$/) do
autotest.files_matching(/^spec\/requests\/.*_spec\.rb$/)
end
end
我的问题是这个文件去哪里处理集成?提前致谢。
Am working my way through Michael Hartl's Rails Tutorial and he says in Chapter 5 that one should configure Mac OS X to run auto test. The code he provides for OS X is:
Autotest.add_hook :initialize do |autotest|
autotest.add_mapping(/^spec\/requests\/.*_spec\.rb$/) do
autotest.files_matching(/^spec\/requests\/.*_spec\.rb$/)
end
end
My question is where does this file go to handle the integration? Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看本教程的这部分。
正如它所说,您可以将此文件放在项目文件夹的根目录中,或者也可以将其保存到您的用户(/Users/YOURUSERNAME/)目录中,这将允许它在所有项目中使用。无论哪种情况,该文件都应命名为
.autotest
您将需要其中的所有内容:
Check out this part of the tutorial.
As it says, you can either put this file in the root of the project folder, or alternatively, you can save it to your user (/Users/YOURUSERNAME/) directory, this will allow it to be used in all projects. In either case, the file should be called
.autotest
You will need all of this in there: