Skip to content

Commit c70baf3

Browse files
authored
Merge pull request #199921 from Homebrew/gping-test
gping: avoid skipping test on Linux
2 parents 4e67d2a + 87c725d commit c70baf3

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Formula/g/gping.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ def install
4141
require "pty"
4242
require "io/console"
4343

44-
r, w, = PTY.spawn("#{bin}/gping google.com")
45-
r.winsize = [80, 130]
46-
sleep 10
47-
w.write "q"
44+
PTY.spawn(bin/"gping", "google.com") do |r, w, _pid|
45+
r.winsize = [80, 130]
46+
sleep 10
47+
w.write "q"
4848

49-
begin
50-
screenlog = r.read
49+
screenlog = r.read_nonblock(1024)
5150
# remove ANSI colors
5251
screenlog.encode!("UTF-8", "binary",
5352
invalid: :replace,
@@ -56,8 +55,6 @@ def install
5655
screenlog.gsub!(/\e\[([;\d]+)?m/, "")
5756

5857
assert_match "google.com (", screenlog
59-
rescue Errno::EIO
60-
# GNU/Linux raises EIO when read is done on closed pty
6158
end
6259
end
6360
end

0 commit comments

Comments
 (0)