showkey: fix test for Linux

Closes #113247.

Signed-off-by: Bo Anderson <mail@boanderson.me>
Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com>
master
nthumann 2022-10-16 17:07:21 +02:00 committed by BrewTestBot
parent de3b598fb6
commit 0cf98a10cf
No known key found for this signature in database
GPG Key ID: 82D7D104050B0F0F
1 changed files with 7 additions and 1 deletions

View File

@ -33,7 +33,13 @@ class Showkey < Formula
test do test do
require "expect" 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.expect(/interrupt .*? or quit .*? character\.\r?\n$/)
pipe.write "Hello Homebrew!" pipe.write "Hello Homebrew!"
sleep 1 sleep 1