0
我想在运行任意RSpec测试之前执行某些代码,但只有在要测试的示例组位于特定目录或携带特定标记的情况下。我如何确定RSpec将运行哪些示例
举例来说,如果我有以下组:
## spec/file_one.rb
describe "Spec One - A group which needs the external app running", :external => true do
describe "Spec Two - A group which does not need the external app running" do
## spec/file_two.rb
describe "Spec Three - A group which does NOT need the external app running" do
## spec/always_run/file_three.rb
describe "Spec Four - A group which does need the external app running"
那我要当一个测试运行包含规格的一个或规格四要执行仅代码。
当我可以依赖文件名时,这样做相对容易,但依靠标签时更难。我如何检查将运行哪些文件示例,然后检查它们的标签?
该代码不是特定的外部,但答案是一样相关,谢谢! – 2013-05-15 20:51:29