运行单导轨单元/功能测试 [英] running single rails unit/functional test
问题描述
作为标题。
红宝石测试/函/ whatevertest.rb不工作,这需要我全部更换要求'test_helper
到要求File.dirname (__FILE__)+'/../ test_helper
。出于某种原因,大部分的这些测试模板有这样的问题,所以我宁可看看是否有一个黑客,我可以绕过它。
ruby test/functionals/whatevertest.rb doesn't work, that requires me to replace all require 'test_helper'
to require File.dirname(__FILE__) + '/../test_helper'
. For some reason most of those test templates have such issue, so I rather to see if there is a hack I could get around it.
推荐答案
在Linux呢?为什么不尝试(CD测试&放大器;&安培;红宝石函/ whatevertest.rb)
。请注意,在括号内,否则你的当前目录切换到子目录重要。它所做的是叉
另一个shell,改变它的子目录,然后运行测试。
On Linux? why not try (cd test && ruby functionals/whatevertest.rb)
. Note, the parentheses are important as otherwise your current directory will change to the subdirectory. What it does is fork
another shell, change to the subdirectory in it, and run the test.
这篇关于运行单导轨单元/功能测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!