xtail: fix test (#5481)
This commit is contained in:
parent
df479bc724
commit
a12b90c745
1 changed files with 21 additions and 1 deletions
|
@ -22,6 +22,26 @@ class Xtail < Formula
|
|||
end
|
||||
|
||||
test do
|
||||
system "#{bin}/xtail"
|
||||
file1 = testpath/"file1"
|
||||
file2 = testpath/"file2"
|
||||
touch file1
|
||||
touch file2
|
||||
|
||||
begin
|
||||
p = IO.popen("#{bin}/xtail file1 file2")
|
||||
# Give xtail a couple seconds before and after so that it could
|
||||
# relatively reliably pick up the changes.
|
||||
sleep 2
|
||||
file1.append_lines "hello\n"
|
||||
file2.append_lines "world\n"
|
||||
sleep 2
|
||||
ensure
|
||||
Process.kill "QUIT", p.pid
|
||||
Process.wait p.pid
|
||||
end
|
||||
|
||||
output = p.read
|
||||
assert_match "hello", output
|
||||
assert_match "world", output
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue