我有一个测试规范,其中describes
个是一个类,其中有不同的contexts
个,每个有不同的it
个块.
有没有办法暂时禁用context
?
我试着在我想禁用的context
中的最顶端添加一个pending "temporarily disabled"
调用,我在运行规范时确实看到了一些关于挂起的内容,但它只是继续运行其余的测试.
这就是我所拥有的:
describe Something
context "some tests" do
it "should blah" do
true
end
end
context "some other tests" do
pending "temporarily disabled"
it "should do something destructive" do
blah
end
end
end
但就像我说的,它只是继续在挂起的调用下运行测试.
搜索让我找到了这mailing list thread个,其中的创造者(?)rspec的负责人说这在我正在运行的rspec 2中是可能的.我猜它确实有效,但没有达到禁用以下所有测试的预期效果,这就是我看到pending
呼叫时的 idea .
还有别的 Select 吗?还是我做错了?