Skip to content

Commit

Permalink
feat: assert shell stderr output
Browse files Browse the repository at this point in the history
  • Loading branch information
in0rdr committed Jan 17, 2025
1 parent af2e7f7 commit 3636f4a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Formula/d/diary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ def install
# application, the diary directory.
#
# Test DIARY_DIR environment variable
assert_match "", shell_output("DIARY_DIR=na #{bin}/diary", 2)
assert_match "The directory 'na' does not exist", shell_output("DIARY_DIR=na #{bin}/diary 2>&1", 2)
# Test diary dir option
assert_match "", shell_output("#{bin}/diary -d na", 2)
assert_match "The directory 'na' does not exist", shell_output("#{bin}/diary -d na 2>&1", 2)
# Test missing diary dir option
assert_match "The diary directory must be provided as (non-option) arg, `--dir` arg,\nor in the DIARY_DIR environment variable, see `diary --help` or DIARY(1)\n", shell_output("#{bin}/diary 2>&1", 1)
end
end

0 comments on commit 3636f4a

Please sign in to comment.