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

Commit

Permalink
Test that Git is always clean when pretending.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabe Berke-Williams committed Oct 22, 2011
1 parent caeb62a commit 40eb3a8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions features/git.feature
Expand Up @@ -17,3 +17,8 @@ Feature: Git cleanliness
When I modify a tracked file
And I run kumade with "pretend-staging"
Then the output should contain "==> ! Cannot deploy: repo is not clean"

Scenario: Git repo is always clean when pretending
Given a dirty repo
When I run kumade with "pretend-staging -p"
Then the output should contain "==> Git repo is clean"
8 changes: 5 additions & 3 deletions features/step_definitions/git_steps.rb
Expand Up @@ -22,8 +22,10 @@
write_file("untracked-file", "anything")
end

Given /^a dirty repo$/ do
modify_tracked_file
end

When /^I modify a tracked file$/ do
write_file('tracked-file', 'clean')
commit_everything_in_repo
append_to_file('tracked-file', 'dirty it up')
modify_tracked_file
end
6 changes: 6 additions & 0 deletions features/support/git.rb
Expand Up @@ -10,6 +10,12 @@ def commit_everything_in_repo
run_simple(git_command)
end
end

def modify_tracked_file
write_file('tracked-file', 'clean')
commit_everything_in_repo
append_to_file('tracked-file', 'dirty it up')
end
end

World(GitHelpers)

0 comments on commit 40eb3a8

Please sign in to comment.