说明:虚假
虚假旨在通过确保您不存根或模拟对象中实际不存在的模拟方法来使单元测试更加可靠。
例子
class PostRepository
def store ( title )
# save a new post in the database
end
end
class PostAdder < Struct . new ( :post_repository )
def add ( title )
post = post_repository . store ( t
<weixin_42150745> 上传 | 大小:103kb