|
|
|
|
|
by randomdata
805 days ago
|
|
Per the dictionary, mock is defined as "not authentic or real, but without the intention to deceive." As that applies to software, a mock is a fully-fledged implementation of an interface, but not the implementation you use under normal use. For example, a mock might be an in-memory database where you normally use a persisted database. Not the real implementation, but does not try to deceive – it is equally functional. Mockery appears to be an assertion library that, bizarrely, moves the assertions into interface implementation. What purpose does it serve? You are going to end up testing implementation details by using that, which is a horrible road to go down. |
|
I wouldn't describe swapping a persisted DB for an in-memory DB mocking personally.