【发布时间】:2014-03-19 07:30:53
【问题描述】:
我像这样使用 rspec:
描述 它'应该检查是否为 xx': 结束
如果满足某些条件,我如何防止运行 it 端主体中的某些测试?例如,如果函数 is_disabled 返回 true,则不应运行以下测试:
it 'should check if the xx1':
end
it 'should check if the xx2':
end
但以下应该:
it 'should check if the xx3':
end
it 'should check if the xx4':
end
你能做到吗:
context "if api calls enabled for MC, @app.is_disabled => 'USD' do
it 'should check if the xx3':
end
it 'should check if the xx4':
end
end
【问题讨论】: