Update tiv.rb

This commit is contained in:
Aaron Liu 2021-07-21 13:22:45 +08:00 committed by Stefan Haustein
parent b3a94dc9ac
commit c0fd4ed19e

8
tiv.rb
View file

@ -4,7 +4,7 @@ class Tiv < Formula
url "https://github.com/stefanhaustein/TerminalImageViewer/archive/v1.1.0.tar.gz" url "https://github.com/stefanhaustein/TerminalImageViewer/archive/v1.1.0.tar.gz"
sha256 "727ddaa048643cb0a13e23bc308415060d99d8b1853883ad339ad7b952050d61" sha256 "727ddaa048643cb0a13e23bc308415060d99d8b1853883ad339ad7b952050d61"
head "https://github.com/stefanhaustein/TerminalImageViewer.git" head "https://github.com/stefanhaustein/TerminalImageViewer.git"
depends_on "gcc" => :build unless OS.linux? uses_from_macos "curl" => :test
depends_on "imagemagick" depends_on "imagemagick"
def install def install
@ -24,7 +24,9 @@ class Tiv < Formula
test do test do
# Downloads a public domain test file from wikimedia commons and displays it. # Downloads a public domain test file from wikimedia commons and displays it.
# NOTE: Test will fail. Will fix when I get to my mac. # NOTE: Test will fail. Will fix when I get to my mac.
assert_equal "", system "curl -o \"test.png\" https://upload.wikimedia.org/wikipedia/commons/2/24/Cornell_box.png"
shell_output("#{bin}/tiv -0 -w 400 -h 400 https://upload.wikimedia.org/wikipedia/commons/2/24/Cornell_box.png").strip assert_equal "▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
",
shell_output("#{bin}/tiv -0 -w 400 -h 400 test.png").strip
end end
end end