2013-05-07 116 views
0

我使用下面的命令来运行从测试文件测试方法:运行多个Ruby测试方法从测试文件

./bundle exec ruby -Ilib test_file.rb -n test_method 

能有人请建议如何进行,如果我需要在命令行上运行多种方法

回答

1

你只需要通过多个-n选项,如下所示:

./bundle exec ruby -Ilib test_file.rb -n test_method -n test_another_method 
+0

太棒了!工作就像一个魅力:) – Arun 2013-05-07 13:19:30

0

我也发现了上述问题的临时解决方案。我从一个方法(我创建它)调用了所有的测试方法。然后用下面的命令来运行它:

./bundle exec ruby -Ilib test_file.rb -n test_method_containing_required_to_run_tests 

在测试文件:

def test_method_containing_required_to_run_tests 
test_method1 
test_method2 
test_method3 
... 
end 

但是当一个方法失败,失败的方法后的方法不是在所有调用。