Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocking commands with a git-like interface #3

Open
dideler opened this issue Jun 15, 2017 · 3 comments
Open

Mocking commands with a git-like interface #3

dideler opened this issue Jun 15, 2017 · 3 comments

Comments

@dideler
Copy link

dideler commented Jun 15, 2017

Is there a way to mock a command that has a git-like interface? For example

mock git clone 0 
mock heroku run 0
@Markcial
Copy link
Owner

Markcial commented Jun 16, 2017

you can indeed the base commands like git or heroku and check that the arguments called are in fact the ones you want.

For example, in a fishtape test.

test "Testing git clone a concrete repository"
  (
     mock git 0 'echo $args'
     git clone git@github.com:fisherman/mock.git
  ) = "clone git@github.com:fisherman/mock.git" -a $status -eq 0
end

on a heroku command you can do the same.

@dideler
Copy link
Author

dideler commented Jun 18, 2017

Thanks, I ended up doing this: dideler/fish-cd-git@91e1d24

@dideler dideler closed this as completed Jun 18, 2017
@Markcial
Copy link
Owner

If you don't mind, i will keep the issue reopen until i get some time to document things like this.

@Markcial Markcial reopened this Jun 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants