Sha256: f270cdb4441bf5525011e16b601a016f4e85ea50505ebc5dcd486ab2b1a3571e

Contents?: true

Size: 1.99 KB

Versions: 5

Compression:

Stored size: 1.99 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(:all) do
    # Disable overrides
    RightConf::OverridesLanguage.instance_variable_set(:@overrides, {})
  end

  after(:all) do
    RightConf::OverridesLanguage.instance_variable_set(:@overrides, nil)
  end

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

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

  it 'should succeed when bundler succeeds' do
    should_execute('bundle', '_0_', '--version').once.and_return(success_result('Bundler version 0'))
    should_execute('bundle', '_0_', 'check').once.and_return(success_result('dependencies are satisfied'))
    @configurator.check_linux.should be_true
  end

  it 'should install bundler if needed' do
    should_execute('gem', 'install', 'bundler', '-v', '0', '--no-ri', '--no-rdoc',
                   {:abort_on_failure=>"Failed to install bundler"}).once.and_return(success_result)
    should_execute('bundle','_0_', 'install',
                           {:abort_on_failure=>"Failed to install gems"}).once.and_return(success_result)
    should_execute('rbenv', 'rehash').times(2).and_return(success_result)
    @configurator.run_linux
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rconf-1.0.13 spec/configurators/bundler_configurator_spec.rb
rconf-1.0.12 spec/configurators/bundler_configurator_spec.rb
rconf-1.0.11 spec/configurators/bundler_configurator_spec.rb
rconf-1.0.10 spec/configurators/bundler_configurator_spec.rb
rconf-1.0.9 spec/configurators/bundler_configurator_spec.rb