From fab6e9247acff50246121c40de48369879bc2c65 Mon Sep 17 00:00:00 2001 From: JLKwong <61807745+JLKwong@users.noreply.github.com> Date: Mon, 26 Apr 2021 11:11:44 -0700 Subject: [PATCH] update `tests/rtc.bats` (fixes #2202) (#2204) Co-authored-by: dogi --- package.json | 2 +- tests/rtc.bats | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3fcd00b232..35dfde00c6 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/tests/rtc.bats b/tests/rtc.bats index f36a185aff..2a26fb2d02 100755 --- a/tests/rtc.bats +++ b/tests/rtc.bats @@ -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' -} \ No newline at end of file + 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.' +}