git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] send-email: test compose functionality

From
Jeff King <peff@peff.net>
Date
Feb 24, 2008, 21:04 UTC
Message-ID
<20080224210414.GB9150@coredump.intra.peff.net>
In-Reply-To
<20080224205720.GA7085@coredump.intra.peff.net>

This is just a basic sanity check that --compose works at all.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t9001-send-email.sh |   29 +++++++++++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 4975048..cbbfa9c 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
-- 
1.5.4.3.307.gacd7
Previous: Jeff King
Message 3 of 3 in “test send-email --compose”
  1. 0/2 test send-email --composeJeff King, Feb 24, 2008
  2. t9001: enhance fake sendmail test harnessJeff King, Feb 24, 2008
  3. 2/2 send-email: test compose functionalityJeff King, Feb 24, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.