diff options
| -rwxr-xr-x | gist | 2 | ||||
| -rw-r--r-- | test.bats | 2 |
2 files changed, 2 insertions, 2 deletions
| @@ -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 |
| @@ -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 | } |