robertdfrench / git-pr

Pull requests without Git(Hub|Lab)
GNU General Public License v3.0
0 stars 1 forks source link

What is the value of `fake_git`? #37

Open robertdfrench opened 2 years ago

robertdfrench commented 2 years ago

At the moment, the tests that depend on fake_git are more-or-less ask the question "have we invoked git with the right arguments?". I am not sure what we get from this.

I think it made sense initially to have fake_git and failing_git so that we could test our strategy for executing subprocesses. I am less sure that it makes sense to keep extending fake_git with new subcommands, only to turn around and write a similar integration test against real git.

calebwherry commented 2 years ago

I agree. This is the nature of mocks like this though. So I'm not sure a way to "fix" it though. If the functions we use have an external dependency and we need to control it, we will have to keep adding functionality. Although I do agree that we are just turning around and doing similar integration tests so it doesn't make a lot of sense.

calebwherry commented 2 years ago

Potential solution: create an in-memory mock git instead of external exes.

robertdfrench commented 2 years ago

We can deal with this once #49 is finished.