Skip to content

Instantly share code, notes, and snippets.

@sstephenson
Created December 28, 2011 18:43
Show Gist options
  • Save sstephenson/1529115 to your computer and use it in GitHub Desktop.
Save sstephenson/1529115 to your computer and use it in GitHub Desktop.
Example bats test
#!/usr/bin/env bats
load test_helper
setup() {
load_fixture rehash
}
teardown() {
destroy_fixture
}
@test "rehash creates the shims directory if it does not exist" {
rm -fr "$RBENV_ROOT/shims"
rbenv rehash
[ -d "$RBENV_ROOT/shims" ]
}
@test "rehash merges all binaries from all installed versions" {
rbenv rehash
for shim in a b c; do
[ -x "$RBENV_ROOT/shims/$shim" ]
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment