【发布时间】:2016-02-02 05:56:23
【问题描述】:
假设我的规范文件夹中有三个导演;功能,测试,集成。
当我运行 bundle exec guard 并按 Enter 键时,有没有办法可以将我的 Guardfile 配置为忽略位于集成目录中的测试用例?
【问题讨论】:
标签: ruby-on-rails rspec guard
假设我的规范文件夹中有三个导演;功能,测试,集成。
当我运行 bundle exec guard 并按 Enter 键时,有没有办法可以将我的 Guardfile 配置为忽略位于集成目录中的测试用例?
【问题讨论】:
标签: ruby-on-rails rspec guard
在您的 Guardfile 中,您可以指定 the command to use when running all specs。您可以指定 rSpec command with a file exclude pattern 来运行除集成规范之外的所有内容:
guard :rspec,
cmd: 'bundle exec rspec',
run_all: { cmd: 'bundle exec rspec --exclude-pattern "**/integrations/*_spec.rb"' } do
# ...
end
您可能需要根据您的确切需要对此进行一些调整,请参阅答案中的链接以获取相关文档。
【讨论】: