This feels to me like the wrong approach. You shouldn't be trying to test if a file exists or a command was run as a 'unit test' (as a sanity check, maybe, but not a test) - that's testing the implementation.
You should be testing for the desired behavior that having that command run or having that file there was supposed to achieve.
IMHO even the use of containers should probably be considered an implementation detail.
You should be testing for the desired behavior that having that command run or having that file there was supposed to achieve.
IMHO even the use of containers should probably be considered an implementation detail.