Created
July 25, 2012 15:00
-
-
Save VladRassokhin/3176620 to your computer and use it in GitHub Desktop.
Test for .rvmrc formats
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
#!/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