Skip to content

Commit

Permalink
upgrade tests/picture.bats with assert_output (fixes #2189)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLKwong committed Apr 14, 2021
1 parent 366263e commit ffa2ac5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/picture.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
load test-helper

@test "$clinom picture" {
run "${clicmd}" picture https://treehouses.io/images/OLE_RPi.png
assert_success
}
run "${clicmd}" picture
assert_success && assert_output -p 'Usage: treehouses picture' && assert_output -p 'Views a picture in the terminal.'
}

@test "$clinom picture foo.png (invalid image)" {
run "${clicmd}" picture HasAnyoneReallyBeenFarEvenasDecidedtoUseEvenGoWanttodoLookMoreLike.png
assert_success && assert_output -p "Can't open file (permission?):"
}


0 comments on commit ffa2ac5

Please sign in to comment.