From 2bb93b95365f31d1a28fbcef2dcba63e10ae1211 Mon Sep 17 00:00:00 2001 From: Johan Holmberg Date: Mon, 17 Aug 2015 23:37:50 +0200 Subject: [PATCH] add test with no errors; test exit code too --- t/CMDTEST_summary.rb | 66 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/t/CMDTEST_summary.rb b/t/CMDTEST_summary.rb index e463583..a704d3c 100644 --- a/t/CMDTEST_summary.rb +++ b/t/CMDTEST_summary.rb @@ -7,7 +7,7 @@ class CMDTEST_summery < Cmdtest::Testcase #----------------------------------- - def test_summary + def test_summary_ERRORS create_file "CMDTEST_foo.rb", [ "class CMDTEST_foo1 < Cmdtest::Testcase", @@ -71,4 +71,68 @@ class CMDTEST_summery < Cmdtest::Testcase end end + #----------------------------------- + + def test_summary_OK + + create_file "CMDTEST_foo.rb", [ + "class CMDTEST_foo1 < Cmdtest::Testcase", + " def setup", + " prepend_path #{BIN.inspect}", + " prepend_path #{PLATFORM_BIN.inspect}", + " end", + "", + + ' def test_foo1', + ' cmd "true" do', + ' exit_zero', + ' end', + ' cmd "true" do', + ' exit_zero', + ' end', + ' cmd "true" do', + ' exit_zero', + ' end', + ' cmd "true" do', + ' exit_zero', + ' end', + ' end', + '', + ' def test_foo2', + ' cmd "true" do', + ' exit_zero', + ' end', + ' end', + '', + ' def test_foo3', + ' cmd "true" do', + ' exit_zero', + ' end', + ' end', + '', + ' def test_foo4', + ' cmd "true" do', + ' exit_zero', + ' end', + ' end', + '', + ' def test_foo5', + ' cmd "true" do', + ' exit_zero', + ' end', + ' end', + '', + 'end', + ] + + cmd_cmdtest_verbose do + stdout_equal /. 1 test classes/ + stdout_equal /. 5 test methods/ + stdout_equal /. 8 commands/ + stdout_equal /. 0 errors/ + stdout_equal /. 0 fatals/ + exit_zero + end + end + end