From 1293ef74eeb7dca18d2f52a48efea1444f98b1bb Mon Sep 17 00:00:00 2001 From: JLKwong <61807745+JLKwong@users.noreply.github.com> Date: Wed, 14 Apr 2021 17:20:50 -0700 Subject: [PATCH] create `tests/resolution.bats` (fixes #2146) (#2160) Co-authored-by: dogi --- package.json | 2 +- tests/resolution.bats | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 tests/resolution.bats diff --git a/package.json b/package.json index 28e4b2213..768d2eba3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@treehouses/cli", - "version": "1.25.39", + "version": "1.25.40", "remote": "4000", "description": "Thin command-line interface for Raspberry Pi low level configuration.", "main": "cli.sh", diff --git a/tests/resolution.bats b/tests/resolution.bats new file mode 100755 index 000000000..fef385d37 --- /dev/null +++ b/tests/resolution.bats @@ -0,0 +1,38 @@ +#!/usr/bin/env bats +load test-helper + +@test "$clinom resolution" { + run "${clicmd}" resolution + assert_success && assert_output -p 'hdmi group should be either' +} + +@test "$clinom resolution cea" { + run "${clicmd}" resolution cea + assert_output -p 'mode is not available' && assert_output -p 'Group CEA has' +} + +@test "$clinom resolution cea 4" { + run "${clicmd}" resolution cea 4 + assert_output -p 'Screen resolution set to mode4:' && assert_output -p 'reboot needed to see the changes' +} + +@test "$clinom resolution cea 1337 (non-existent mode)" { + run "${clicmd}" resolution cea 1337 + assert_output -p 'mode is not available' && assert_output -p 'Group CEA has' +} + +@test "$clinom resolution dmt" { + run "${clicmd}" resolution dmt + assert_output -p 'mode is not available' && assert_output -p 'Group DMT has' +} + +@test "$clinom resolution dmt 4" { + run "${clicmd}" resolution dmt 4 + assert_output -p 'Screen resolution set to mode4:' && assert_output -p 'reboot needed to see the changes' +} + +@test "$clinom resolution dmt 1337 (non-existent mode)" { + run "${clicmd}" resolution dmt 1337 + assert_output -p 'mode is not available' && assert_output -p 'Group DMT has' +} +