6

我有一个很短的功能要测试:

def my_fn
  if some_condition
    super(@my_attr)
  end
end

而且我希望我的规范能够验证是否super被调用,但我不能执行以下操作,因为:super似乎不是曾经发送过的消息:

    expect(subject).to receive(:super)
4

0 回答 0