sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 7902898566c3a28e9391ee4f9f9adb3ffcce51e1
parent 5fdcfa1bd6520c72b7a53d2b425a221f9f8ff268
Author: Dan Callaghan <djc@djc.id.au>
Date:   Mon, 23 May 2022 19:03:03 +1000

tests: capture subprocess output from sup-add

Diffstat:
M test/integration/test_sup-add.rb | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/test/integration/test_sup-add.rb b/test/integration/test_sup-add.rb
@@ -9,7 +9,9 @@ class TestSupAdd < Minitest::Test
   end
 
   def test_can_add_maildir_source
-    assert system({"SUP_BASE" => @path}, "bin/sup-add", "maildir:///some/path")
+    _out, _err = capture_subprocess_io do
+      assert system({"SUP_BASE" => @path}, "bin/sup-add", "maildir:///some/path")
+    end
 
     generated_sources_yaml = File.read "#{@path}/sources.yaml"
     assert_equal <<EOS, generated_sources_yaml
@@ -35,7 +37,9 @@ EOS
   id: 1
   labels: []
 EOS
-    assert system({"SUP_BASE" => @path}, "bin/sup-add", "maildir:///other/path")
+    _out, _err = capture_subprocess_io do
+      assert system({"SUP_BASE" => @path}, "bin/sup-add", "maildir:///other/path")
+    end
 
     generated_sources_yaml = File.read "#{@path}/sources.yaml"
     assert_equal <<EOS, generated_sources_yaml
@@ -59,7 +63,9 @@ EOS
 
   ## https://github.com/sup-heliotrope/sup/issues/545
   def test_source_with_invalid_uri_chars_in_path
-    assert system({"SUP_BASE" => @path}, "bin/sup-add", "maildir:~/.mail/gmail/[Gmail]/.All Mail/")
+    _out, _err = capture_subprocess_io do
+      assert system({"SUP_BASE" => @path}, "bin/sup-add", "maildir:~/.mail/gmail/[Gmail]/.All Mail/")
+    end
 
     generated_sources_yaml = File.read "#{@path}/sources.yaml"
     assert_equal <<EOS, generated_sources_yaml