【问题标题】:How to configure guard-rspec to ignore a directory when all the test cases are running?当所有测试用例都在运行时,如何配置guard-rspec以忽略目录?
【发布时间】:2016-02-02 05:56:23
【问题描述】:

假设我的规范文件夹中有三个导演;功能,测试,集成。 当我运行 bundle exec guard 并按 Enter 键时,有没有办法可以将我的 Guardfile 配置为忽略位于集成目录中的测试用例?

【问题讨论】:

    标签: ruby-on-rails rspec guard


    【解决方案1】:

    在您的 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
    

    您可能需要根据您的确切需要对此进行一些调整,请参阅答案中的链接以获取相关文档。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-08
      • 2015-06-23
      • 2020-06-08
      • 2015-06-08
      • 1970-01-01
      • 2014-06-27
      • 2016-02-25
      相关资源
      最近更新 更多