2016-02-09 23:21:57 +00:00
|
|
|
set -g gist $DIRNAME/fixtures/gist
|
|
|
|
|
|
|
|
function -S setup
|
2016-02-13 11:37:49 +00:00
|
|
|
function -S spin -a url
|
|
|
|
cat $gist/(basename $url).json ^ /dev/null
|
2016-02-09 23:21:57 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function -S teardown
|
2016-02-13 11:37:49 +00:00
|
|
|
functions -e spin
|
2016-02-09 23:21:57 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test "$TESTNAME - Fail if URL is an empty string"
|
|
|
|
1 -eq (
|
|
|
|
__fisher_gist_to_name ""
|
|
|
|
printf $status
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2016-02-13 11:37:49 +00:00
|
|
|
test "$TESTNAME - Fail if URL is invalid"
|
|
|
|
-z (__fisher_gist_to_name gist.github.com/bar)
|
|
|
|
end
|
|
|
|
|
2016-02-09 23:21:57 +00:00
|
|
|
test "$TESTNAME - Retrieve the name of the first *.fish file in the JSON stream"
|
|
|
|
foo = (__fisher_gist_to_name gist.github.com/foo)
|
|
|
|
end
|