【问题标题】:How to run a focused functional test in rails 3如何在 Rails 3 中运行重点功能测试
【发布时间】:2011-08-04 19:59:52
【问题描述】:

在 users_controller_test.rb 我有:

def test_name 
  ...
end

def test_name_2 
  ...
end

etc...

是否可以只从命令行运行第一个测试?比如:

 rake test:functionals TEST=test/functional/users_controller_test.rb (plus the test name?)

谢谢

【问题讨论】:

    标签: ruby-on-rails ruby ruby-on-rails-3 testing rake


    【解决方案1】:

    你可以这样做:

    ruby test/functional/users_controller_test.rb -n test_name

    【讨论】:

    • 当我尝试上述方法时,我收到了require: no such file to load -- test/functional/../test_helper (LoadError)
    【解决方案2】:

    您可能会从 ruby test/functional/users_controller_test.rb --something

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-16
      • 2011-06-29
      • 2012-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多