【发布时间】:2021-02-06 08:38:19
【问题描述】:
我在 Rspec 接受我的 let 定义之一的范围时遇到了一些问题。
这是我的测试,所有课程都运行良好,因为当我将它们打印出来时,它们很甜。
code removed due to silly error
提前致谢!
【问题讨论】:
我在 Rspec 接受我的 let 定义之一的范围时遇到了一些问题。
这是我的测试,所有课程都运行良好,因为当我将它们打印出来时,它们很甜。
code removed due to silly error
提前致谢!
【问题讨论】:
您的it 块缺少do 和end:
describe "Initialisation of order within User object" do
it "Creates an order property set to an empty array" do
expect(user.instance_variable_defined?(:@orders)).to be(true)
expect(user.instance_variable_get(:@orders)).to eq([])
end
end
【讨论】: