Created
August 4, 2010 06:13
-
-
Save bmizerany/507733 to your computer and use it in GitHub Desktop.
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
#!/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