Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-02-25 00:04:14 +0300
committerJunio C Hamano <gitster@pobox.com>2008-02-25 05:17:46 +0300
commit8a8bf4690e20a545561249a9b393c1ef3239c03d (patch)
treed577213956e46c9a0e0dae7b2c8945da67d0882d /t/t9001-send-email.sh
parent6d34a2bad11f241e56423511d4a0d62a1f378668 (diff)
send-email: test compose functionality
This is just a basic sanity check that --compose works at all. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-xt/t9001-send-email.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 4975048007..cbbfa9cb49 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -137,4 +137,33 @@ test_expect_success 'Valid In-Reply-To when prompting' '
! grep "^In-Reply-To: < *>" msgtxt1
'
+test_expect_success 'setup fake editor' '
+ (echo "#!/bin/sh" &&
+ echo "echo fake edit >>\$1"
+ ) >fake-editor &&
+ chmod +x fake-editor
+'
+
+test_expect_success '--compose works' '
+ clean_fake_sendmail &&
+ echo y | \
+ GIT_EDITOR=$(pwd)/fake-editor \
+ GIT_SEND_EMAIL_NOTTY=1 \
+ git send-email \
+ --compose --subject foo \
+ --from="Example <nobody@example.com>" \
+ --to=nobody@example.com \
+ --smtp-server="$(pwd)/fake.sendmail" \
+ $patches \
+ 2>errors
+'
+
+test_expect_success 'first message is compose text' '
+ grep "^fake edit" msgtxt1
+'
+
+test_expect_success 'second message is patch' '
+ grep "Subject:.*Second" msgtxt2
+'
+
test_done