Skip to content

Commit

Permalink
add test for versions.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapis committed Mar 28, 2012
1 parent 763db9d commit 7d4bb53
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions fast/versions.conf_comment_test.sh
@@ -0,0 +1,41 @@
source "$rvm_path/scripts/rvm"

: prepare
true TMPDIR:${TMPDIR:=/tmp}:
d=$TMPDIR/test-versions-conf
mcd(){ mkdir -p $1 ; cd $1 ; }

: generate
mcd $d/a
rvm use 1.9.3@versions-conf-a --create --versions-conf
[[ -f .versions.conf ]] # status=0

mcd $d/b
rvm use 1.8.7@versions-conf-b --create --versions-conf
[[ -f .versions.conf ]] # status=0

: test
mcd $d/a
rvm current # match=/^ruby-1.9.3-.*@versions-conf-a$/
mcd $d/b
rvm current # match=/^ruby-1.8.7-.*@versions-conf-b$/

: test installing gem
mcd $d/a
gem list # match!=/haml/
echo "ruby-gem-install=haml" >> .versions.conf
cd .
gem list # match=/haml/

: test bundler
mcd $d/b
gem list # match!=/haml/
printf "ruby-gem-install=bundler\nruby-bundle-install=true\n" >> .versions.conf
printf "source :rubygems\n\ngem 'haml'\n" > Gemfile
cd .
gem list # match=/haml/; match=/bundler/

: clean
rvm --force gemset delete 1.9.3@versions-conf-a
rvm --force gemset delete 1.8.7@versions-conf-b
rm -rf $d

0 comments on commit 7d4bb53

Please sign in to comment.