【问题标题】:Minitest's equivalent to RSpec's receiveMinitest 相当于 RSpec 的接收
【发布时间】:2017-10-24 13:44:29
【问题描述】:

在 Rspec 中可以做到

expect(foo).to receive(:bark)

MiniTest 中的等价物是什么?

assert_send 似乎没有不同的行为)

【问题讨论】:

    标签: ruby rspec minitest


    【解决方案1】:

    看起来这个问题已经在这里回答了:How to assert certain method is called with Ruby minitest framework?

    简而言之 - 您应该使用模拟来检查方法是否被调用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-10
      • 2017-01-17
      • 2020-10-07
      • 1970-01-01
      • 1970-01-01
      • 2018-09-13
      相关资源
      最近更新 更多