tags:

views:

24

answers:

1

The app I'm creating uses git to move repositories around. I'm trying to find a strategy that will let me implement a step like:

Then the commit "d786239d8sd" is pushed from "[email protected]:opsb/conference_hub" to "[email protected]:conference_hub_ci.git" 

Given the command uses git, which interacts with the filesystem, how do I implement this step in a way that will be rolled back afterwards?

A: 

I would not be using hard coded paths to the git repos. That way, they can vary by environment. As a given in scenario, you can say:

Given "a repo exists at "[email protected]:/some/path.git"

The step would, of course create a git repo in a known state in that location.

When "something or other"
Then the commit "d786239d8sd" is pushed from "[email protected]:/some/path" to "[email protected]:/some/path.git"

This strategy allows you to still do full-stack testing without trying to test that Github, Heroku, and git all work.

Steve Ross
Would the Given that you suggest create a repository on the local file system?
opsb
That was my thought -- or copy one from a fixture location.
Steve Ross