Sha256: 86d5d1aa4aaff1b0c3cb985b08eda726f35b5f4661b508b6ef22e74d218a3b27

Contents?: true

Size: 1.67 KB

Versions: 15

Compression:

Stored size: 1.67 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::PassengerConfigurator do

  before(:each) do
    lang = RightConf::Language.parse('passenger {}')
    @configurator = lang.configurators.first
    [:report_check, :report_result, :report_fatal, :report_success].each do |meth|
      flexmock(@configurator).should_receive(meth)
    end
  end

  it 'should set defaults' do
    @configurator.__send__(:set_defaults)
    @configurator.right_site_src_path.should == Dir.getwd
    @configurator.library_src_path.should == File.expand_path(File.join(Dir.getwd, '..', 'library'))
    @configurator.gem_version.should == RightConf::PassengerConfigurator::PASSENGER_GEM_VERSION
    @configurator.install_path.should == @configurator.__send__(:default_install_path)
    @configurator.user.should == ENV['USER']
  end

  it 'should default to /opt/nginx when possible' do
    to_check = File.exist?('/opt/nginx') ? '/opt/nginx' :
      (File.exist?('/opt') ? '/opt' : '/')
    if File.writable?(to_check)
      @configurator.__send__(:default_install_path).should == '/opt/nginx'
    else
      pending '/opt/nginx not writable'
    end
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
rconf-0.6.25 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.24 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.23 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.22 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.21 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.20 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.19 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.18 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.17 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.16 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.15 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.14 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.13 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.11 spec/configurators/passenger_configurator_spec.rb
rconf-0.6.10 spec/configurators/passenger_configurator_spec.rb