Sha256: 39f1112331f0afec296a9c7e2f9edfff286bf7a0cf616397192b3a721cb54f56

Contents?: true

Size: 952 Bytes

Versions: 6

Compression:

Stored size: 952 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Merb::Config do
  before(:all) do
    @config_yml = File.expand_path(File.dirname(__FILE__) / ".." / "fixtures")
  end
  
  it "should have a default configuration" do
    Merb::Config.defaults.should be_is_a(Hash)
    Merb::Config.defaults[:merb_root].should == Dir.pwd
  end
  
  it "should not load the config.yml file if it does not exist" do
    Merb::Config.setup.should be_is_a(Hash)
    Merb::Config.setup.should == Merb::Config.defaults
  end
  
  it "should load the config.yml file if it exists" do
    Merb::Config.defaults.merge!(:merb_root => @config_yml)
    Merb::Config.setup.should be_is_a(Hash)
    Merb::Config.setup[:host].should == "127.0.0.1"
  end

  it "should accept erb in the config.yml file" do
    Merb::Config.defaults.merge!(:merb_root => @config_yml)
    Merb::Config.setup.should be_is_a(Hash)
    Merb::Config.setup[:environment].should == "test"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
merb-0.4.1 spec/merb/config_spec.rb
merb-0.5.0 spec/merb/config_spec.rb
merb-0.4.2 spec/merb/config_spec.rb
merb-0.5.1 spec/merb/config_spec.rb
merb-0.5.2 spec/merb/config_spec.rb
merb-0.5.3 spec/merb/config_spec.rb