aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <typebrook@gmail.com>2021-05-06 11:28:50 +0800
committerHsieh Chin Fan <typebrook@gmail.com>2021-05-06 11:28:50 +0800
commitaf1c8e9662aaa50fa2343569b252622421d9e577 (patch)
tree5467cdbd6636ea884d315a349a0d0d95c722c897
parent2dd010b6813ad6c4b447cb9c1d4a60837d1a640b (diff)
Do not show hint when fetching gists in test
-rwxr-xr-xgist2
-rw-r--r--test.bats2
2 files changed, 2 insertions, 2 deletions
diff --git a/gist b/gist
index 5f7cb74..0b8546e 100755
--- a/gist
+++ b/gist
@@ -430,7 +430,7 @@ _fetch_gists_with_pagnation() {
430 local next_page='' 430 local next_page=''
431 [[ -e $HEADER ]] && next_page=$(sed -Ene '/^[lL]ink: / s/.+page=([[:digit:]]+)>; rel=\"next\".+/\1/p' $HEADER) 431 [[ -e $HEADER ]] && next_page=$(sed -Ene '/^[lL]ink: / s/.+page=([[:digit:]]+)>; rel=\"next\".+/\1/p' $HEADER)
432 [[ -z $next_page ]] && break 432 [[ -z $next_page ]] && break
433 printf "%-4s gists fetched\n" $(( ($next_page -1) * $per_page )) > /dev/tty 433 [[ $hint != false ]] && printf "%-4s gists fetched\n" $(( ($next_page -1) * $per_page )) >/dev/tty
434 434
435 _fetch_gists "?per_page=$per_page&page=$next_page" >> $1 435 _fetch_gists "?per_page=$per_page&page=$next_page" >> $1
436 done || return 1 436 done || return 1
diff --git a/test.bats b/test.bats
index 20ca6a1..dd0f54c 100644
--- a/test.bats
+++ b/test.bats
@@ -71,7 +71,7 @@ export GIST_API_TOKEN='dd43dc9949a5b4a1d6c7''b779f13af357282016e4'
71} 71}
72 72
73@test "The user command should get the list of public gists from a user" { 73@test "The user command should get the list of public gists from a user" {
74 run ./gist user defunkt 74 hint=false run ./gist user defunkt
75 [ "$status" -eq 0 ] 75 [ "$status" -eq 0 ]
76 [[ "${lines[0]}" =~ (https://gist.github.com/[0-9a-z]+ defunkt) ]] 76 [[ "${lines[0]}" =~ (https://gist.github.com/[0-9a-z]+ defunkt) ]]
77} 77}