From bbe4e5e0b0c5bd86320bc0c766f76bdfa519af01 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Wed, 21 Jul 2021 13:29:56 +0800 Subject: [PATCH] Update terminalimageviewer.rb --- terminalimageviewer.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/terminalimageviewer.rb b/terminalimageviewer.rb index 6a9a7b4..b1cc8fa 100644 --- a/terminalimageviewer.rb +++ b/terminalimageviewer.rb @@ -4,6 +4,7 @@ class Terminalimageviewer < Formula url "https://github.com/stefanhaustein/TerminalImageViewer/archive/v1.1.0.tar.gz" sha256 "727ddaa048643cb0a13e23bc308415060d99d8b1853883ad339ad7b952050d61" head "https://github.com/stefanhaustein/TerminalImageViewer.git" + uses_from_macos "curl" => :test depends_on "gcc" => :build unless OS.linux? depends_on "imagemagick" @@ -30,8 +31,10 @@ class Terminalimageviewer < Formula test do # Downloads a public domain test file from wikimedia commons and displays it. - # For some reason, when you redirect the output it is blank. - assert_equal "", - shell_output("#{bin}/tiv -0 https://upload.wikimedia.org/wikipedia/commons/2/24/Cornell_box.png").strip + # NOTE: Test will fail. Will fix when I get to my mac. + system "curl -o \"test.png\" https://upload.wikimedia.org/wikipedia/commons/2/24/Cornell_box.png" + assert_equal "â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„â–„ +", + shell_output("#{bin}/tiv -0 -w 400 -h 400 test.png").strip end end