Skip to content

Instantly share code, notes, and snippets.

@bmizerany
Created August 4, 2010 06:13
Show Gist options
  • Save bmizerany/507733 to your computer and use it in GitHub Desktop.
Save bmizerany/507733 to your computer and use it in GitHub Desktop.
#!/usr/bin/env roundup
describe "redis-cli(1)"
# Start the redis server on port 9999
port=9999
printf "PORT $port\n" | ./redis-server - &
redis_pid=$!
# Give redis time to start listening
sleep "0.3"
# When this tests sub-shell is done or errors, kill the redis-server.
trap "kill -9 $redis_pid" EXIT
# Reduce risk of carpel tunnel
function rcli() {
./redis-cli -p $port "$@"
}
it_sets_a_value() {
exp=bar
rcli set foo $exp
test "$(rcli get foo)" = "bar"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment