stash: add test for the create command line arguments
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>
Thomas Gummerer committed
Feb 19, 2017 at 11:03 UTC
6f5ccd4df56da70434cd807a458a4de015098971
1 file changed
+18
t/t3903-stash.sh
+18
@@ -784,4 +784,22 @@ test_expect_success 'push -m shows right message' '
784
test_cmp expect actual
785
'
786
787
+test_expect_success 'create stores correct message' '
788
+ >foo &&
789
+ git add foo &&
790
+ STASH_ID=$(git stash create "create test message") &&
791
+ echo "On master: create test message" >expect &&
792
+ git show --pretty=%s -s ${STASH_ID} >actual &&
793
+ test_cmp expect actual
794
+'
795
+
796
+test_expect_success 'create with multiple arguments for the message' '
797
+ >foo &&
798
+ git add foo &&
799
+ STASH_ID=$(git stash create test untracked) &&
800
+ echo "On master: test untracked" >expect &&
801
+ git show --pretty=%s -s ${STASH_ID} >actual &&
802
+ test_cmp expect actual
803
+'
804
+
805
test_done