From 0cf98a10cf5f96628f4be4dae63a36e41ec5b991 Mon Sep 17 00:00:00 2001 From: nthumann Date: Sun, 16 Oct 2022 17:07:21 +0200 Subject: [PATCH] showkey: fix test for Linux Closes #113247. Signed-off-by: Bo Anderson Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/showkey.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Formula/showkey.rb b/Formula/showkey.rb index b44cb369182..b1fc6a8ef52 100644 --- a/Formula/showkey.rb +++ b/Formula/showkey.rb @@ -33,7 +33,13 @@ class Showkey < Formula test do require "expect" - output = Utils.safe_popen_write("script", "-q", "/dev/null", bin/"showkey") do |pipe| + args = if OS.linux? + ["script", "-q", "/dev/null", "-c", bin/"showkey"] + else + ["script", "-q", "/dev/null", bin/"showkey"] + end + + output = Utils.safe_popen_write(*args) do |pipe| pipe.expect(/interrupt .*? or quit .*? character\.\r?\n$/) pipe.write "Hello Homebrew!" sleep 1