Sha256: 5c88143ea6a42eb464004739e3d8737e67e870777ffd995b98e59ea244d0d625
Contents?: true
Size: 1.36 KB
Versions: 3
Compression:
Stored size: 1.36 KB
Contents
require 'spec_helper' describe Rda::Rvm do subject { Rda::Rvm.new } before(:all) { Dir.chdir(File.join(File.dirname(__FILE__), '../../dummy')) } describe '#setup' do context 'when RVM is installed' do before(:all) do @rvm_path = ENV['rvm_path'] ENV['rvm_path'] ||= '/tmp' subject.setup end after(:all) do `rm -f #{Rda::Rails.root}/.rvmrc` ENV['rvm_path'] = @rvm_path end it 'creates a file named .rvmrc' do File.should be_exists("#{Rda::Rails.root}/.rvmrc") end describe 'checking the contents of .rvmrc' do before { @contents = File.read("#{Rda::Rails.root}/.rvmrc") } it "configs RVM properly" do contents = <<-RVMRC if [[ -s "#{ENV['rvm_path']}/environments/ruby-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}@dummy" ]]; then . "#{ENV['rvm_path']}/environments/ruby-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}@dummy" else rvm --create use "ruby-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}@dummy" fi RVMRC @contents.should == contents end end end context 'when RVM is not installed' do before do subject.should_receive(:installed?).and_return(false) subject.setup end it 'does not create .rvmrc' do File.should_not be_exists("#{Rda::Rails.root}/.rvmrc") end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rda-0.3.3 | spec/lib/rda/rvm_spec.rb |
rda-0.3.2 | spec/lib/rda/rvm_spec.rb |
rda-0.3.1 | spec/lib/rda/rvm_spec.rb |