Skip to content

Instantly share code, notes, and snippets.

@VladRassokhin
Created July 25, 2012 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save VladRassokhin/3176620 to your computer and use it in GitHub Desktop.
Save VladRassokhin/3176620 to your computer and use it in GitHub Desktop.
Test for .rvmrc formats
#!/bin/bash -l
# Cleaning env
rvm use system
##
## This works fine return '1.9.3@acme'
##
echo "with 'use', must report 1.9.3@acme"
# Setup test files
echo "rvm use 1.9.3@acme --create" > .rvmrc # valid rvm command
echo "rvm current" > rvm-shell-rvm-current-script.sh
# Testing
rvm-shell --path $(pwd) -c "rvm current" # system
rvm-shell --path $(pwd) rvm-shell-rvm-current-script.sh # system
##
## This fails return 'system'
##
echo "without 'use', reports 'system'"
# Setup test files
echo "rvm 1.9.3@acme --create" > .rvmrc # valid rvm command
echo "rvm current" > rvm-shell-rvm-current-script.sh
# Testing
rvm-shell --path $(pwd) -c "rvm current" # 1.9.3@acme
rvm-shell --path $(pwd) rvm-shell-rvm-current-script.sh # 1.9.3@acme
## Cleaning
rm .rvmrc rvm-shell-rvm-current-script.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment