From 9624df817805d7581c0c61f698e716e41e5f2188 Mon Sep 17 00:00:00 2001 From: Brett Chalupa Date: Mon, 9 Dec 2024 20:30:14 -0500 Subject: [PATCH] Output CLI errors in test assertions So there's more info about what failed to help with debugging --- test/cli_test.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cli_test.rb b/test/cli_test.rb index 897771e..70a21d5 100644 --- a/test/cli_test.rb +++ b/test/cli_test.rb @@ -32,7 +32,7 @@ def test_cli_help assert cmd("--help") end assert_match /Usage/, out - assert err.empty?, "errors not empty" + assert err.empty?, "errors not empty: #{err}" end def test_cli_verbose @@ -41,14 +41,14 @@ def test_cli_verbose end assert_match /Generating site/, out assert_match /Site successfully generated/, out - assert err.empty?, "errors not empty" + assert err.empty?, "errors not empty: #{err}" end def test_cli_base_url out, err = capture_subprocess_io do assert cmd("#{@schema} -b https://example.com") end - assert err.empty?, "errors not empty" + assert err.empty?, "errors not empty: #{err}" assert File.read(File.join("output", 'index.html')).include?("") end @@ -57,7 +57,7 @@ def test_cli_version assert cmd("--version") end assert_match /#{GraphQLDocs::VERSION}/, out - assert err.empty?, "errors not empty" + assert err.empty?, "errors not empty: #{err}" end private