Skip to content
Browse files

Update test/git-stsh

  • Loading branch information...
1 parent 1e4423b commit 35a35e86e592a808a862a641b7ce041227e69bca @MaxNanasy committed Feb 20, 2013
Showing with 27 additions and 1 deletion.
  1. +27 −1 test/git-stsh
View
28 test/git-stsh
@@ -1 +1,27 @@
-git stsh
+#!/bin/sh
+
+original_dir="$PWD"
+
+setup() {
+ git_dir=$(mktemp)
+ trap EXIT "cd '$(shell-quote "$original_dir")' && rm -rf '$(shell-quote "$git_dir")'"
+ cd "$(git_dir)" && git init
+}
+
+testStshModifiedFile() {
+ setup
+ echo a > x
+ git add x
+ git commit --allow-empty-message -m ''
+ echo b > x
+ git stsh
+ assertEquals a "$(cat x)"
+}
+
+testStshAndPopModifiedFile() {
+ testStshModifiedFile
+  git stsh pop
+ assertEquals b "$(cat x)"
+}
+
+. shunit2/src/shunit2

0 comments on commit 35a35e8

Please sign in to comment.
Something went wrong with that request. Please try again.