0
module A
H = { c: @user }
def b
H.fetch(:c).should_not be_nil
end
end
World(A)
@user
在黄瓜步骤定义。当我调用它时,我得到一个错误,因为@user是零。
注意:如果我将代码更改为@user.should_not be_nil
,我不会收到异常。
如何获取Cucumber模块中的实例变量?