【问题标题】:how to run .feature + _spec.rb + _test.rb with autotest如何使用自动测试运行 .feature + _spec.rb + _test.rb
【发布时间】:2010-04-19 23:54:48
【问题描述】:

在我的一个包含一些现有代码的项目中,一些代码被 _test.rb 文件覆盖,其他代码被 _spec.rb 覆盖,我们引入了 .feature

它变成了一个很好的混合检查。 我很困惑如何运行 .feature、_spec.rb 和 _test.rb 进行红绿循环。

【问题讨论】:

    标签: ruby-on-rails rspec cucumber autotest zentest


    【解决方案1】:

    在网上搜索了一番后,我在 .autotest 文件中找到了解决方案

    Autotest.add_hook :reset do |at|
      # at.clear_mappings
      at.add_mapping(/^(.*?)(_spec)?\.rb$/) { |filename, m| m[2] ? filename : "#{m[1]}_spec.rb" }
    end
    

    显然安装了所有适当的 gem,只需运行 autotest

    我现在正在寻找一种更智能/更好/优化的方法来做到这一点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-04-29
      • 2023-03-10
      • 1970-01-01
      • 1970-01-01
      • 2019-11-06
      • 1970-01-01
      • 2010-09-10
      • 1970-01-01
      相关资源
      最近更新 更多