Skip to content

Commit 6056d13

Browse files
BrewTestBotchenrui333GunniBusch
committed
mdfried 0.18.3
mdfried: fix test for 0.18.3 Co-authored-by: Rui Chen <rui@chenrui.dev> Co-authored-by: Leon Adomaitis <leon@adomaitis.de>
1 parent ab2f0fc commit 6056d13

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

Formula/m/mdfried.rb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
class Mdfried < Formula
22
desc "Terminal markdown viewer"
33
homepage "https://github.com/benjajaja/mdfried"
4-
url "https://github.com/benjajaja/mdfried/archive/refs/tags/v0.18.2.tar.gz"
5-
sha256 "af31a4ca3215a54ea826246cba8b2fbbb957164fd8ee7f8f253f751e98ff4ee9"
4+
url "https://github.com/benjajaja/mdfried/archive/refs/tags/v0.18.3.tar.gz"
5+
sha256 "c19f3e678b758b565c3931a1d6ab4860694cdc9c9bba36ecb580c16a35ab2a87"
66
license "GPL-3.0-or-later"
77
head "https://github.com/benjajaja/mdfried.git", branch: "master"
88

@@ -31,19 +31,22 @@ def install
3131
test do
3232
assert_match version.to_s, shell_output("#{bin}/mdfried --version")
3333

34+
# Fails in Linux CI with "I/O error: No such device or address" (no TTY available)
35+
return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"]
36+
3437
(testpath/"test.md").write <<~MARKDOWN
3538
# Hello World
3639
MARKDOWN
3740

38-
cmd = "#{bin}/mdfried #{testpath}/test.md 2>&1"
39-
output = if OS.mac?
40-
shell_output(cmd)
41-
else
42-
require "pty"
43-
r, _w, pid = PTY.spawn({ "FONTCONFIG_FILE" => "#{etc}/fonts/fonts.conf" }, cmd)
41+
begin
42+
output = testpath/"output"
43+
pid = spawn bin/"mdfried", testpath/"test.md", "--log", [:out, :err] => output.to_s
44+
sleep 3
45+
assert_match "Detecting supported graphics protocols...", output.read
46+
assert_path_exists testpath.glob("*.log").first
47+
ensure
48+
Process.kill("TERM", pid)
4449
Process.wait(pid)
45-
r.read_nonblock(1024)
4650
end
47-
assert_match "cursor position could not be read", output
4851
end
4952
end

0 commit comments

Comments
 (0)