From 8a8bf4690e20a545561249a9b393c1ef3239c03d Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 24 Feb 2008 16:04:14 -0500 Subject: [PATCH] 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 --- t/t9001-send-email.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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 -- 2.30.2