运行单导轨单元/功能测试 [英] running single rails unit/functional test

查看:126
本文介绍了运行单导轨单元/功能测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为标题。

红宝石测试/函/ 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆