Sha256: 340aa25438cdbde63819898cce894b8adf2ff7e799ca4a47a76d5379a30e180f

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 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::BuildConfigurator do

  before(:each) do
    @configurator = create_configurator('build { path "../source" }')
  end

  it 'should build' do
    flexmock(Dir).should_receive(:chdir).with('../source', Proc).once.and_yield
    should_execute('./configure', {:abort_on_failure=>"Failed to run ./configure"}).once.ordered
    should_execute('make', {:abort_on_failure=>"Failed to run make"}).once.ordered
    should_sudo('echo').once.ordered
    should_sudo('make', 'install', {:abort_on_failure=>"Failed to run make install"}).once.ordered
    @configurator.run
  end

  it 'should honor only_if' do
    @configurator.instance_eval { only_if('false') }
    should_execute.and_return { raise "Command should not execute" }
    @configurator.run
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rconf-0.7.10 spec/configurators/build_configurator_spec.rb
rconf-0.7.9 spec/configurators/build_configurator_spec.rb