Skip to content

Commit

Permalink
update tests/ntp.bats (fixes #2213) (#2214)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <dogi@users.noreply.github.com>
  • Loading branch information
rjpadilla and dogi authored Apr 26, 2021
1 parent d8ba03f commit 5c66007
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
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.47",
"version": "1.25.48",
"remote": "4000",
"description": "Thin command-line interface for Raspberry Pi low level configuration.",
"main": "cli.sh",
Expand Down
21 changes: 18 additions & 3 deletions tests/ntp.bats
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
#!/usr/bin/env bats
load test-helper

@test "$clinom ntp internet" {
run "${clicmd}" ntp internet
assert_success && assert_output -p 'Success'
@test "$clinom ntp (no arguments)" {
run "${clicmd}" ntp
assert_failure && assert_output -p 'only local or internet'
}

@test "$clinom ntp (invalid argument)" {
run "${clicmd}" ntp foobar
assert_failure && assert_output -p 'only local or internet'
}

@test "$clinom ntp internet (too many arguments)" {
run "${clicmd}" ntp internet foobar
assert_failure && assert_output -p 'Too many arguments.'
}

@test "$clinom ntp local" {
run "${clicmd}" ntp local
assert_success && assert_output -p 'Success'
}

@test "$clinom ntp internet" {
run "${clicmd}" ntp internet
assert_success && assert_output -p 'Success'
}

0 comments on commit 5c66007

Please sign in to comment.