-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46c39b4
commit 7372be0
Showing
6 changed files
with
123 additions
and
44 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
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
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,44 @@ | ||
# Manual | ||
|
||
`commander` will automatically search for a `commander.yaml` in the current working directory. | ||
|
||
## Tests | ||
|
||
```yaml | ||
config: # Config for all tests | ||
dir: /tmp #Set working directory | ||
env: # Environment variables | ||
KEY: global | ||
timeout: 5000 #Timeout in ms | ||
|
||
tests: | ||
echo hello: # Define command as title | ||
stdout: hello # Default is to check if it contains the given characters | ||
exit-code: 0 # Assert exit-code | ||
|
||
it should fail: | ||
command: invalid | ||
stderr: | ||
contains: | ||
- invalid # Assert only contain work | ||
exactly: "/bin/sh: 1: invalid: not found" | ||
line-count: 1 # Assert amount of lines | ||
lines: # Assert specific lines | ||
1: "/bin/sh: 1: invalid: not found" | ||
exit-code: 127 | ||
|
||
it has configs: | ||
command: echo hello | ||
stdout: | ||
contains: | ||
- hello #See test "it should fail" | ||
exactly: hello | ||
line-count: 1 | ||
config: | ||
dir: /home/user # Overwrite working dir | ||
env: | ||
KEY: local # Overwrite env variable | ||
ANOTHER: yeah # Add another env variable | ||
timeout: 1000 # Overwrite timeout | ||
exit-code: 0 | ||
``` |
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
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,15 @@ | ||
config: | ||
env: | ||
KEY: global | ||
tests: | ||
echo $KEY: | ||
stdout: global | ||
exit-code: 0 | ||
|
||
it should overwrite env: | ||
command: echo $KEY | ||
stdout: local | ||
config: | ||
env: | ||
KEY: local | ||
exit-code: 0 |
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,3 @@ | ||
tests: | ||
echo hello: | ||
exit-code: 0 |