-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from mbland/null
Add null command
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#! /usr/bin/env bash | ||
# | ||
# Returns a successful exit value if the framework is properly installed | ||
# | ||
# If it fails, it should generate output indicating what's wrong with the | ||
# framework installation and exit with an error value. | ||
# | ||
# Useful for tests that only need to verify that the framework is installed | ||
# correctly, or for `_GO_STANDALONE` scripts that run a separate `./go` script | ||
# to install the framework. | ||
# | ||
# For maximum performance, avoid spawning a process to set `COLUMNS` like so: | ||
# | ||
# COLUMNS=80 {{go}} {{cmd}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#! /usr/bin/env bats | ||
|
||
load environment | ||
|
||
setup() { | ||
@go.create_test_go_script | ||
} | ||
|
||
teardown() { | ||
@go.remove_test_go_rootdir | ||
} | ||
|
||
@test "$SUITE: a good installation emits nothing and exits successfully" { | ||
COLUMNS=80 run "$TEST_GO_SCRIPT" null | ||
assert_success '' | ||
} | ||
|
||
@test "$SUITE: a bad installation emits errors and exits unsuccessfully" { | ||
rmdir "$TEST_GO_SCRIPTS_DIR" | ||
COLUMNS=80 run "$TEST_GO_SCRIPT" null | ||
assert_failure \ | ||
"ERROR: command script directory $TEST_GO_SCRIPTS_DIR does not exist" | ||
} |