|
|
|
|
|
by al2o3cr
3378 days ago
|
|
What if there are some core classes or third-party
libraries we use also require Time.now to work?
The "once" expectation will fail, indicating that the mock doesn't accurately represent the behavior of the system?Note that in the DI case, unless there's additional work being done to inject the double everywhere else `Time.now` gets used the spec will silently use the built-in version. |
|
There's no need to inject the double everywhere in other tests because the built-in version is the behavior we want the function to work.