From: Jeff King Date: Sun, 24 Feb 2008 21:04:14 +0000 (-0500) Subject: send-email: test compose functionality X-Git-Tag: v1.5.5-rc0~153 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8a8bf4690e20a545561249a9b393c1ef3239c03d;p=git.git send-email: test compose functionality This is just a basic sanity check that --compose works at all. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh index 497504800..cbbfa9cb4 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 " \ + --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