Skip to content

Commit

Permalink
send-email: test compose functionality
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Feb 25, 2008
1 parent 6d34a2b commit 8a8bf46
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions t/t9001-send-email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8a8bf46

Please sign in to comment.