|
1 | 1 | class Mdfried < Formula |
2 | 2 | desc "Terminal markdown viewer" |
3 | 3 | 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" |
6 | 6 | license "GPL-3.0-or-later" |
7 | 7 | head "https://github.com/benjajaja/mdfried.git", branch: "master" |
8 | 8 |
|
@@ -31,19 +31,22 @@ def install |
31 | 31 | test do |
32 | 32 | assert_match version.to_s, shell_output("#{bin}/mdfried --version") |
33 | 33 |
|
| 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 | + |
34 | 37 | (testpath/"test.md").write <<~MARKDOWN |
35 | 38 | # Hello World |
36 | 39 | MARKDOWN |
37 | 40 |
|
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) |
44 | 49 | Process.wait(pid) |
45 | | - r.read_nonblock(1024) |
46 | 50 | end |
47 | | - assert_match "cursor position could not be read", output |
48 | 51 | end |
49 | 52 | end |
0 commit comments