Skip to content

Commit

Permalink
Merge pull request #202085 from Homebrew/geometry-test
Browse files Browse the repository at this point in the history
geometry: update test to drop `expect` dependency
  • Loading branch information
chenrui333 authored Dec 22, 2024
2 parents b1b2b0e + bd6eb63 commit b8b3c8e
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Formula/g/geometry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Geometry < Formula
end

depends_on "zsh-async"
uses_from_macos "expect" => :test
uses_from_macos "zsh" => :test

def install
Expand All @@ -27,15 +26,12 @@ def caveats

test do
(testpath/".zshrc").write "source #{opt_pkgshare}/geometry.zsh"
(testpath/"prompt.exp").write <<~EOS
set timeout 1
spawn zsh
expect {
"▲" { exit 0 }
default { exit 1 }
}
EOS

system "expect", "-f", "prompt.exp"
require "expect"
require "pty"
PTY.spawn("zsh") do |r, w, _pid|
refute_nil r.expect("▲", 1), "Zsh prompt missing ▲"
w.write "exit\n"
end
end
end

0 comments on commit b8b3c8e

Please sign in to comment.