From 470783004cfd0894f01857d9c1f448467d0c76e9 Mon Sep 17 00:00:00 2001 From: markokajzer Date: Fri, 9 Feb 2024 20:51:12 +0100 Subject: [PATCH] test: test help message See https://github.com/rspec/rspec-core/issues/2311 --- spec/argument_parser_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/argument_parser_spec.rb b/spec/argument_parser_spec.rb index 132be56..acf41b4 100644 --- a/spec/argument_parser_spec.rb +++ b/spec/argument_parser_spec.rb @@ -17,9 +17,9 @@ expect(options[:log_level]).to eq(:debug) end - # When this test is enabled, rspec randomly skips other specs... - xit "shows the help message" do + it "shows the help message" do expect { described_class.parse!(args: ["--help"]) } - .to output("Show this message").to_stdout + .to raise_error(SystemExit) + .and output(/Show this message/).to_stdout end end