Sha256: b8f36887d36dd4f0eecf7bad998c6c6cee5db8fe2cc56df6472dad37a6f7201b

Contents?: true

Size: 895 Bytes

Versions: 1

Compression:

Stored size: 895 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
Configliere.use :environment

describe "Configliere::Environment" do
  before do
    @config = Configliere::Param.new
  end

  describe 'loads environment variables' do
    it 'loads a simple value into the corresponding symbolic key' do
      ENV.should_receive(:[]).with('HOME').and_return('/fake/path')
      @config.environment_variables 'HOME'
      @config[:home].should == '/fake/path'
    end
    it 'loads a hash into the individual params' do
      ENV.should_receive(:[]).with('HOME').and_return('/fake/path')
      ENV.should_receive(:[]).with('POWER_SUPPLY').and_return('1.21 jigawatts')
      @config.environment_variables :home => 'HOME', 'delorean.power_supply' => 'POWER_SUPPLY'
      @config[:home].should == '/fake/path'
      @config[:delorean][:power_supply].should == '1.21 jigawatts'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
configliere-0.0.3 spec/configliere/environment_spec.rb