File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 55require 'open3'
66
77class TestCommitEmail < Test ::Unit ::TestCase
8+ STDIN_DELIMITER = "---\n "
9+
810 def setup
911 @ruby = Dir . mktmpdir
1012 Dir . chdir ( @ruby ) do
@@ -20,7 +22,7 @@ def setup
2022 @sendmail = File . join ( Dir . mktmpdir , 'sendmail' )
2123 File . write ( @sendmail , <<~SENDMAIL )
2224 #!/usr/bin/env ruby
23- puts "---"
25+ print #{ STDIN_DELIMITER . dump }
2426 puts STDIN.read
2527 SENDMAIL
2628 FileUtils . chmod ( 0755 , @sendmail )
@@ -43,11 +45,10 @@ def test_sendmail_encoding
4345 '--viewer-uri' , 'https://github.com/ruby/ruby/commit/' ,
4446 '--error-to' , 'cvs-admin@ruby-lang.org' ,
4547 ] , '' , true )
48+ stdin = out . split ( STDIN_DELIMITER , 2 ) . last
4649
4750 assert_true ( status . success? )
48- assert_equal ( out , <<~EOS )
49- master: #{ short_rev } (Jóhän Grübél)
50- ---
51+ assert_equal ( stdin , <<~EOS )
5152 Mime-Version: 1.0
5253 Content-Type: text/plain; charset=utf-8
5354 Content-Transfer-Encoding: quoted-printable
You can’t perform that action at this time.
0 commit comments