2
Object.any_instance should_receive vs Expect()接收
以下代码段按预期工作: Object.any_instance.should_receive(:subscribe) 但是,当使用新的rspec期望时,它不起作用: expect(Object.any_instance).to receive(:subscribe) 错误是: expected: 1 time with any arguments received: 0 times with any arguments 我该如何使用Expect()来接收它?