Detect local changes before a git update. See issue #75.
This commit is contained in:
@@ -44,4 +44,22 @@ describe GitUpdater do
|
||||
@git_updater.update().should === "Already up-to-date."
|
||||
end
|
||||
end
|
||||
|
||||
describe "#has_local_changes?" do
|
||||
after :each do
|
||||
stub_system_command(@git_updater, /^git diff --exit-code 2>&1/, @stub_value)
|
||||
@git_updater.has_local_changes?.should === @expected
|
||||
end
|
||||
|
||||
it "should return true if there are local changes" do
|
||||
@stub_value = 'diff'
|
||||
@expected = true
|
||||
end
|
||||
|
||||
it "should return false if there are no local changes" do
|
||||
@stub_value = ''
|
||||
@expected = false
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user