I’m creating a wrapper around Git. But I’m having dificult testing it. My big problem is to know what is the best approach to test filesystem changes. How can I test if a file was deleted, changed. Also testing the outputs of the git commands.
Is there any way to mock this?
For example, if on the wrapper I have a command that wraps the “git add . && git commit -m 'some message”
The thing to look out for is not to rely much on bash commands and their outputs and use any libgit2 bindings if any. I think there is go-git module that has bindings for such things.
Unfortunally I cannot rely much on on go-git (using it in some parts of the wrapper), there’s a lot of missing basic functionality from go-git, (git merge for example) and some other things are not very usefull.