我试图以这种方式构建我的测试,以便我可以自己运行某些上下文块,但还需要在个别块中进一步实施嵌套标签。事情是这样的: context 'outer context', :outer_tag do
it 'inner it', :tag1 do
expect(1).to eq(1)
end
it 'inner it 2', :tag2 do
ex
如何验证Foobar#some_method是否需要一个块。东西simliar到Foobar.new.respond_to?(:some_method) class Foobar
def some_method
yield
end
end
为什么? 这对测试合同界面很有用。确保我存根的方法有一个不变的API。 方法我试过 mth = Foobar.new.met