Skip to content

Commit

Permalink
update tests/detect.bats (fixes #2171) (#2172)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
rjpadilla and dogi committed Apr 26, 2021
1 parent fab6e92 commit a42651b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@treehouses/cli",
"version": "1.25.49",
"version": "1.25.50",
"remote": "4000",
"description": "Thin command-line interface for Raspberry Pi low level configuration.",
"main": "cli.sh",
Expand Down
25 changes: 25 additions & 0 deletions tests/detect.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ load test-helper
assert_success
}

@test "$clinom detect (invalid argument)" {
run "${clicmd}" detect asdf
assert_output --partial "options supported."
}

@test "$clinom detect bluetooth" {
run "${clicmd}" detect bluetooth
assert_success
Expand All @@ -21,6 +26,21 @@ load test-helper
assert_success
}

@test "$clinom detect rpi full" {
run "${clicmd}" detect rpi model
assert_success
}

@test "$clinom detect rpi (invalid second argument)" {
run "${clicmd}" detect rpi foobar
assert_failure && assert_output --partial "commands supported"
}

@test "$clinom detect <option> <an extra unnecessary option> (too many arguments)" {
run "${clicmd}" detect wifi foobar
assert_failure && assert_output --partial "Too many arguments"
}

@test "$clinom detect wifi" {
run "${clicmd}" detect wifi
assert_success
Expand All @@ -30,3 +50,8 @@ load test-helper
run "${clicmd}" detect arm
assert_success
}

@test "$clinom detect arch" {
run "${clicmd}" detect arch
assert_success
}

0 comments on commit a42651b

Please sign in to comment.