Skip to content

Commit

Permalink
create tests/resolution.bats (fixes #2146) (#2160)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
JLKwong and dogi authored Apr 15, 2021
1 parent efa3e19 commit 1293ef7
Show file tree
Hide file tree
Showing 2 changed files with 39 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.39",
"version": "1.25.40",
"remote": "4000",
"description": "Thin command-line interface for Raspberry Pi low level configuration.",
"main": "cli.sh",
Expand Down
38 changes: 38 additions & 0 deletions tests/resolution.bats
Original file line number Diff line number Diff line change
@@ -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'
}

0 comments on commit 1293ef7

Please sign in to comment.