@matheusbsbs / matheus-bagliano / commits / 8a8bf4690e
Fork 0

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>

Jeff King committed Feb 24, 2008 at 16:04 UTC 8a8bf4690e20a545561249a9b393c1ef3239c03d
1 file changed +29
t/t9001-send-email.sh
+29
@@ -137,4 +137,33 @@ test_expect_success 'Valid In-Reply-To when prompting' '
137 ! grep "^In-Reply-To: < *>" msgtxt1
138 '
139
140 +test_expect_success 'setup fake editor' '
141 + (echo "#!/bin/sh" &&
142 + echo "echo fake edit >>\$1"
143 + ) >fake-editor &&
144 + chmod +x fake-editor
145 +'
146 +
147 +test_expect_success '--compose works' '
148 + clean_fake_sendmail &&
149 + echo y | \
150 + GIT_EDITOR=$(pwd)/fake-editor \
151 + GIT_SEND_EMAIL_NOTTY=1 \
152 + git send-email \
153 + --compose --subject foo \
154 + --from="Example <nobody@example.com>" \
155 + --to=nobody@example.com \
156 + --smtp-server="$(pwd)/fake.sendmail" \
157 + $patches \
158 + 2>errors
159 +'
160 +
161 +test_expect_success 'first message is compose text' '
162 + grep "^fake edit" msgtxt1
163 +'
164 +
165 +test_expect_success 'second message is patch' '
166 + grep "Subject:.*Second" msgtxt2
167 +'
168 +
169 test_done