Sha256: 73dd0d6b1cf85b38343b0c14d50fdb67295b44ba4df16592127db020cfc42b4d
Contents?: true
Size: 860 Bytes
Versions: 16
Compression:
Stored size: 860 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') Configliere.use :env_var describe "Configliere::EnvVar" 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.env_vars '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.env_vars :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
16 entries across 16 versions & 1 rubygems