Sha256: edd8e1094b9028dfaa6d67cdea640d7e61bb17cf197896721eb599a398db5128
Contents?: true
Size: 1.15 KB
Versions: 2
Compression:
Stored size: 1.15 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe "ConfigLoader" do describe ".load" do def prepare_mocks(running_env, project_root) Rails.stub!(:env).and_return(running_env) ConfigLoader::Map.should_receive(:new).with('database', running_env, project_root).and_return(@map_mock) @map_mock.should_receive(:load).and_return('config') end before(:each) do @map_mock = mock('ConfigLoader::Map') end it "should delegate to ConfigLoader::Map.populate" do prepare_mocks('development', '/home/user/project') ConfigLoader.load('database').should == 'config' end it "should delegate to ConfigLoader::Map.populate with the given running_env" do prepare_mocks('production', '/home/user/project') ConfigLoader.load('database', 'production').should == 'config' end it "should delegate to ConfigLoader::Map.populate with the given project_root" do prepare_mocks('development', '/home/user/another_project') ConfigLoader.load('database', 'development', '/home/user/another_project').should == 'config' end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
configloader-0.2.1 | spec/config_loader_spec.rb |
configloader-0.2.0 | spec/config_loader_spec.rb |