The following example uses expect and receive to mock an Order's call to a CreditCardService, so that the test passes only if the call is made without having to actually make it.
class Order
def cancel
CreditCardService.instance.refund transaction_id
end
end
describe Order do
des...