-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nickg
committed
Mar 8, 2018
1 parent
5031695
commit fe5a1f3
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
. ./is_command.sh | ||
. ./http_download.sh | ||
. ./assert.sh | ||
|
||
# test normal 200 | ||
test1() { | ||
http_download /dev/null https://raw.githubusercontent.com/client9/shlib/master/README.md | ||
assertEquals "$?" "0" "return != 0 on valid URL" | ||
} | ||
|
||
# test 404, missing | ||
test2() { | ||
http_download /dev/null https://raw.githubusercontent.com/client9/shlib/master/does_not_exist | ||
assertNotEquals "$?" "0" "expected return to be non-zero on 404" | ||
} | ||
|
||
test1 | ||
test2 | ||
|