Sha256: 8a1b68fb4e25957a9207e9cab30d0bc9829123cc5482746e2409de8606451f66

Contents?: true

Size: 1.63 KB

Versions: 3

Compression:

Stored size: 1.63 KB

Contents

# Copyright (C) 2011 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::PackagesConfigurator do

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

  before(:each) do
    lang = RightConf::Language.parse('packages { debian %w(deb1 deb2); centos %w(cent1 cent2) }')
    @configurator = lang.configurators.first
    [:report_check, :report_result, :report_fatal, :report_success].each do |meth|
      flexmock(@configurator).should_receive(meth)
    end
  end

  it 'should install packages on Ubuntu' do
    flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
      'sudo', 'aptitude', 'install', 'deb1', 'deb2', 
      {:abort_on_failure=>"Failed to install packages"}).and_return(success_result)
    @configurator.run_linux_ubuntu
  end

  it 'should install packages on Centos' do
    flexmock(RightConf::Command.instance).should_receive(:execute).once.with(
      'sudo', 'yum', 'install', '-y', 'cent1', 'cent2',
      {:abort_on_failure=>"Failed to install packages"}).and_return(success_result)
    @configurator.run_linux_centos
  end

end
  

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rconf-0.5.9 spec/configurators/packages_configurator_spec.rb
rconf-0.5.8 spec/configurators/packages_configurator_spec.rb
rconf-0.5.6 spec/configurators/packages_configurator_spec.rb