简体   繁体   English

如何进行自动测试以注意到子目录中的更改?

[英]How can I get autotest to notice changes in subdirectories?

I have some submodules organized like this: 我有一些这样子模块:

|-- app
|   |-- models
|   |   |-- foo
|   |   |   |-- foo-1.rb
|   |   |   |-- foo-2.rb
|   |   |   |-- foo-3.rb
|   |   |-- foo.rb

How can I get autotest to notice changes made to foo-*.rb, and then run the appropriate specs? 如何进行自动测试以注意到对foo-*。rb所做的更改,然后运行适当的规范?

Perhaps you should investigate watchr 也许你应该调查观察者

https://github.com/mynyml/watchr https://github.com/mynyml/watchr

It's similar to autotest, while being quite a bit more configurable and more easily setup. 它与自动测试相似,但更具可配置性且更易于设置。

You can populate your autotest/discover.rb file with mappings: 您可以使用映射填充autotest / discover.rb文件:

Autotest.add_hook :initialize do |at|
  # match the model name (the whole Regex object is in _)
  at.add_mapping(%r%^app/models/(foo)/\w+\.rb$%, true) do |filename, _|
    "spec/models/#{_[1]}_spec.rb"
  end
end

You can find more how to use the mappings and hooks in the API docs . 您可以在API文档中找到更多如何使用映射和挂钩的信息

另一个有趣的选择是后卫

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何获得自动测试以在失败后继续运行规格而不停止? - How can I get autotest to keep running my specs after failures without stopping? 如何使用Test / Unit,MiniTest在自动测试中获得颜色输出? - How can I get color output in autotest using Test/Unit, MiniTest? 如何获得自动测试(ZenTest)以查看命名空间的内容? - How do I get autotest (ZenTest) to see my namespaced stuff? 如何在Rails项目中进行rspec /自动测试? - How do I get rspec / autotest going on a rails project? 如何手动获取自动测试以在特定测试文件上运行? 在Rails应用程序根目录中编辑.autotest无效 - How do I manually get autotest to run on specific test files? Editing .autotest in rails app root has no effect 如何在Windows / Cygwin上安装Autotest和Autotest Pure? - How do I install Autotest and Autotest Pure on Windows/Cygwin? 我无法在Rails 3.0.4和MongoID 2.0.0.rc.7上进行自动测试 - I can't get autotest working with Rails 3.0.4 and MongoID 2.0.0.rc.7 除非明确告知我,如何告诉自动测试不要重新运行所有测试? - How can I tell autotest to not rerun all tests unless I explicitly tell it to? 如何告诉自动测试正确跟踪应用程序源中的更改? - how to tell autotest to correctly track changes in app source? 如何进行自动测试以正确改变单数模型和复数控制器 - How do I get autotest to properly inflect singular models and plural controllers
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM