diff --git a/Formula/h/heksa.rb b/Formula/h/heksa.rb index 247071c35bc1e..c55351db9c159 100644 --- a/Formula/h/heksa.rb +++ b/Formula/h/heksa.rb @@ -30,19 +30,8 @@ def install end test do - require "pty" - - r, _w, pid = PTY.spawn("#{bin}/heksa -l 16 -f asc -o no #{test_fixtures("test.png")}") - + output = shell_output("#{bin}/heksa --limit 16 --format asc --offset-format no #{test_fixtures("test.png")}") # remove ANSI colors - begin - output = r.read.gsub(/\e\[([;\d]+)?m/, "") - assert_match(/^.PNG/, output) - rescue Errno::EIO - # GNU/Linux raises EIO when read is done on closed pty - end - - Process.wait(pid) - assert_equal 0, $CHILD_STATUS.exitstatus + assert_match(/^\.PNG/, output.gsub(/\e\[([;\d]+)?m/, "")) end end