From 473ba20f4cc6f28d4599d643d8dfa25166130836 Mon Sep 17 00:00:00 2001 From: Michael Cho Date: Sat, 4 Jan 2025 17:24:29 -0500 Subject: [PATCH] gnu-getopt: update Linux keg_only message, test with shell_output --- Formula/g/gnu-getopt.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Formula/g/gnu-getopt.rb b/Formula/g/gnu-getopt.rb index de42df41162e8..7955ae986e448 100644 --- a/Formula/g/gnu-getopt.rb +++ b/Formula/g/gnu-getopt.rb @@ -46,7 +46,7 @@ class GnuGetopt < Formula keg_only :shadowed_by_macos, "macOS provides BSD getopt" on_linux do - keg_only "conflicts with util-linux" + keg_only "it conflicts with util-linux" end def install @@ -63,9 +63,9 @@ def install end test do - system bin/"getopt", "-o", "--test" + output = shell_output("#{bin}/getopt --longoptions foo --options ab:c test -b bar --foo baz") + assert_equal " -b 'bar' --foo -- 'test' 'baz'\n", output # Check that getopt is enhanced - quiet_system bin/"getopt", "-T" - assert_equal 4, $CHILD_STATUS.exitstatus + assert_empty shell_output("#{bin}/getopt --test", 4) end end