Sha256: ab211f7ca6a4235f686276b6407e70a2062b2633a100762eb6c285024738d698

Contents?: true

Size: 1.79 KB

Versions: 7

Compression:

Stored size: 1.79 KB

Contents

# Copyright (C) 2011-2012 RightScale, Inc, All Rights Reserved Worldwide.
#
# THIS PROGRAM IS CONFIDENTIAL AND PROPRIETARY TO RIGHTSCALE
# AND CONSTITUTES A VALUABLE TRADE SECRET. Any unauthorized use,
# reproduction, modification, or disclosure of this program is
# strictly prohibited. Any use of this program by an authorized
# licensee is strictly subject to the terms and conditions,
# including confidentiality obligations, set forth in the applicable
# License Agreement between RightScale.com, Inc. and
# the licensee

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))

describe RightConf::BundlerConfigurator do

  def success_result(output=nil)
    flexmock('res', :success? => true, :output => output)
  end

  before(:each) do
    @configurator = create_configurator('bundler { version "0" }')
    RightConf::Command.instance.instance_variable_set(:@rvm_prefix, 'r@g')
  end

  after(:each) do
    RightConf::Command.instance.instance_variable_set(:@rvm_prefix, nil)
  end

  it 'should succeed when bundler succeeds' do
    should_execute_in_ruby('bundle', '--version').once.and_return(success_result('0'))
    @configurator.check_linux.should be_true
  end

  it 'should install bundler if needed' do
    should_execute_in_ruby('bundle', '--version').once.and_return(success_result('1'))
    should_execute_in_ruby('bundle','_0_', 'install',
                           {:abort_on_failure=>"Failed to install gems"}).once.and_return(success_result)
    should_execute_in_ruby('gem', 'uninstall', 'bundler', '-a', '-x').once.and_return(success_result)
    should_execute_in_ruby('gem', 'install', 'bundler', '-v', '0', '--no-ri', '--no-rdoc',
                           {:abort_on_failure=>"Failed to install bundler"}).once.and_return(success_result)
    @configurator.run_linux
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rconf-0.9.25 spec/configurators/bundler_configurator_spec.rb
rconf-0.9.24 spec/configurators/bundler_configurator_spec.rb
rconf-0.9.23 spec/configurators/bundler_configurator_spec.rb
rconf-0.9.22 spec/configurators/bundler_configurator_spec.rb
rconf-0.9.21 spec/configurators/bundler_configurator_spec.rb
rconf-0.9.20 spec/configurators/bundler_configurator_spec.rb
rconf-0.9.19 spec/configurators/bundler_configurator_spec.rb