rspec示例中的接收器是什么?

时间:2015-02-26 21:41:26

标签: ruby rspec

例如,在https://github.com/cloudfoundry/cloud_controller_ng/blob/aacfd8/spec/unit/controllers/runtime/apps_controller_spec.rb#L17中,我想确定如何解决“get”方法。我知道的最快的方法是转储接收器 .method(:get).source_location,但我不知道接收器在这里。

1 个答案:

答案 0 :(得分:1)

您不需要明确指定您发送的任何不合格邮件的接收者,因为它隐式self。因此,在您的情况下,method(:get)会告诉您发送给get的{​​{1}}方法实现了谁/什么。