Sha256: 47a0d61f045a4efd93a377adde7e2c226a5ff28be5d6ab02f1d9baa75e9f5eed

Contents?: true

Size: 863 Bytes

Versions: 1

Compression:

Stored size: 863 Bytes

Contents

require 'environment/spec_helper'

require 'rad/environment'
require 'rad/spec/environment'

describe 'config' do  
  before :each do 
    @c = Rad::Config.new
    @c.environment = 'development'
    @c.key = 'value'
    @c.key2 = 'value2'
  end
    
  it "should merge with existing config" do    
    @c.key2!.should == 'value2'
    
    @c.merge_config! "#{spec_dir}/config.yml"
    @c.key!.should == 'value'
    @c.key2!.should == 'another_value'
  end
  
  it "should merge hashes (with the following order: config.default <= config <= config.environment)" do   
    @c.merge_config! "#{spec_dir}/config.yml"    
    
    @c.user_service.default_key("invalid").should == 'default_value'
    @c.user_service.key("invalid").should == 'value'
    @c.user_service.test_key("invalid").should == 'test_value'
    @c.user_service.name.should == 'test_name'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rad_core-0.0.13 spec/environment/config_spec.rb