Skip to content

Commit

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

@test "$clinom rtc on PCF8523 (not supported)" {
run "${clicmd}" rtc on PCF8523
assert_failure && assert_output -p 'Error: the clock is not supported.'
}

@test "$clinom rtc on DS1307 (not supported)" {
run "${clicmd}" rtc on DS1307
assert_failure && assert_output -p 'Error: the clock is not supported.'
}

@test "$clinom rtc on rasclock" {
run "${clicmd}" rtc on rasclock
assert_success && assert_output -p 'Success'
assert_success && assert_output -p 'Success: clock changed. Please reboot'
}

@test "$clinom rtc on ds3231" {
run "${clicmd}" rtc on ds3231
assert_success && assert_output -p 'Success'
assert_success && assert_output -p 'Success: clock changed. Please reboot'
}

@test "$clinom rtc off" {
run "${clicmd}" rtc off
assert_success && assert_output -p 'Success'
}
assert_success && assert_output -p 'Success: clock changed. Please reboot'
}

@test "$clinom rtc on asdf (invalid clock)" {
run "${clicmd}" rtc on asdf
assert_failure && assert_output -p 'Error: the clock is not supported.'
}

0 comments on commit fab6e92

Please sign in to comment.