stash: add test for the create command line arguments
authorThomas Gummerer <t.gummerer@gmail.com>
Sun, 19 Feb 2017 11:03:09 +0000 (11:03 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Feb 2017 07:47:41 +0000 (23:47 -0800)
Currently there is no test showing the expected behaviour of git stash
create's command line arguments. Add a test for that to show the
current expected behaviour and to make sure future refactorings don't
break those expectations.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3903-stash.sh
index 35771158077f407778ad20edf9c0539defc235f2..ffe3549ea560d0df3948bef933008261f81a86ff 100755 (executable)
@@ -784,4 +784,22 @@ test_expect_success 'push -m shows right message' '
        test_cmp expect actual
 '
 
+test_expect_success 'create stores correct message' '
+       >foo &&
+       git add foo &&
+       STASH_ID=$(git stash create "create test message") &&
+       echo "On master: create test message" >expect &&
+       git show --pretty=%s -s ${STASH_ID} >actual &&
+       test_cmp expect actual
+'
+
+test_expect_success 'create with multiple arguments for the message' '
+       >foo &&
+       git add foo &&
+       STASH_ID=$(git stash create test untracked) &&
+       echo "On master: test untracked" >expect &&
+       git show --pretty=%s -s ${STASH_ID} >actual &&
+       test_cmp expect actual
+'
+
 test_done