Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ If you are contributing to ops, debugging, or want to try out bleeding edge feat

This means your global ops script will point directly to the repo and you can make live changes.

# run tests with bats
# https://github.com/sstephenson/bats
bats test

## License

MIT License
Expand Down
26 changes: 26 additions & 0 deletions test/main.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bats


@test "valid syntax" {
bash -n ops.sh
}

@test "valid version" {
[[ "$(bash ops.sh version)" =~ "ops version " ]]
}

@test "valid help" {
[[ "$(bash ops.sh help)" =~ "Usage: ops <command>" ]]
}

@test "services successfully started" {
bash ops.sh start

[[ -z "$(bash ops.sh ps | grep Exit)" ]]
}

@test "services successfully stopped" {
bash ops.sh stop

[[ -z "$(bash ops.sh ps | grep Up)" ]]
}