diff-so-fancy: fix test

diff-so-fancy needs some actual diff as input, or it will just hang
there waiting for input from stdin.

Also, do not manually set TERM in test, which should no longer be
necessary since https://github.com/Homebrew/brew/pull/982.
master
Zhiming Wang 2016-09-18 00:24:36 -04:00
parent 95f7c9b60a
commit 3072d366cb
1 changed files with 14 additions and 2 deletions

View File

@ -22,7 +22,19 @@ class DiffSoFancy < Formula
end end
test do test do
ENV["TERM"] = "xterm" diff = <<-EOS.undent
system bin/"diff-so-fancy" diff --git a/hello.c b/hello.c
index 8c15c31..0a9c78f 100644
--- a/hello.c
+++ b/hello.c
@@ -1,5 +1,5 @@
#include <stdio.h>
int main(int argc, char **argv) {
- printf("Hello, world!\n");
+ printf("Hello, Homebrew!\n");
}
EOS
assert_match "modified: hello.c", pipe_output(bin/"diff-so-fancy", diff, 0)
end end
end end