Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
Remove all git remotes before and after scenarios.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Oct 21, 2011
1 parent 4a72bc0 commit 7e4eab3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 9 additions & 2 deletions features/step_definitions/git_steps.rb
Expand Up @@ -18,7 +18,14 @@
end
end

Before("@creates-remote") do
in_current_dir do
remove_all_git_remotes
end
end

After("@creates-remote") do
heroku_remotes = `git remote -v show | grep heroku | grep fetch | cut -f1`.strip.split
heroku_remotes.each { |remote| `git remote rm #{remote} 2> /dev/null` }
in_current_dir do
remove_all_git_remotes
end
end
8 changes: 8 additions & 0 deletions features/support/git_remotes.rb
@@ -0,0 +1,8 @@
module GitRemoteHelpers
def remove_all_git_remotes
remotes = `git remote -v show | grep fetch | cut -f1`.strip.split
remotes.each { |remote| `git remote rm #{remote} 2> /dev/null` }
end
end

World(GitRemoteHelpers)

0 comments on commit 7e4eab3

Please sign in to comment.