January 2020
Intermediate to advanced
532 pages
13h 31m
English
A good alternative to implementing stubs is the Mocking package. This package is fairly straightforward to use. We will quickly go over how to use Mocking to apply the same stubs that we applied earlier.
In order to follow this exercise, you can copy the code from the original CreditApproval module to a new module called CreditApprovalMockingStub. Now, follow these steps:
using Mockingfunction open_account(first_name, last_name, email) @mock(check_background(first_name, last_name)) || return :failure account_number = create_account(first_name, last_name, email) notify_downstream(account_number) ...
Read now
Unlock full access