diff options
| author | Xu Cheng | 2015-03-25 22:12:37 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-03-25 22:12:37 +0800 |
| commit | 5ab87c60e2d4787dd6a3ef2cf2cb9538c340822d (patch) | |
| tree | c69047fc929892d754e203a80eceb7c3c6029a7b | |
| parent | 5e253e1f8f76324ce8ae046c3e438816a92e203b (diff) | |
| download | homebrew-5ab87c60e2d4787dd6a3ef2cf2cb9538c340822d.tar.bz2 | |
todo-txt: add test
Closes #38058.
Signed-off-by: Xu Cheng <xucheng@me.com>
| -rw-r--r-- | Library/Formula/todo-txt.rb | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/Library/Formula/todo-txt.rb b/Library/Formula/todo-txt.rb index 3acd8e762..60b251eec 100644 --- a/Library/Formula/todo-txt.rb +++ b/Library/Formula/todo-txt.rb @@ -1,16 +1,14 @@ -require 'formula' - class TodoTxt < Formula - homepage 'http://todotxt.com/' + homepage "http://todotxt.com/" url "https://github.com/ginatrapani/todo.txt-cli/releases/download/v2.10/todo.txt_cli-2.10.tar.gz" - sha1 "3967bc42ca23cc984e94939b783cf118fe86b1b0" + sha256 "b59417a26feeafd811e0f1ff17e85e69ac5bcb1a0544b736f539ffb8fe27f6a9" - head 'https://github.com/ginatrapani/todo.txt-cli.git' + head "https://github.com/ginatrapani/todo.txt-cli.git" def install - bin.install 'todo.sh' - prefix.install 'todo.cfg' # Default config file - bash_completion.install 'todo_completion' + bin.install "todo.sh" + prefix.install "todo.cfg" # Default config file + bash_completion.install "todo_completion" end def caveats; <<-EOS.undent @@ -18,4 +16,11 @@ class TodoTxt < Formula cp #{prefix}/todo.cfg ~/.todo.cfg EOS end + + test do + cp prefix/"todo.cfg", testpath/".todo.cfg" + inreplace testpath/".todo.cfg", "export TODO_DIR=$(dirname \"$0\")", "export TODO_DIR=#{testpath}" + system bin/"todo.sh", "add", "Hello World!" + system bin/"todo.sh", "list" + end end |
