spec/profigure_spec.rb in profigure-0.0.2 vs spec/profigure_spec.rb in profigure-0.0.3
- old
+ new
@@ -1,9 +1,9 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "Profigure" do
- before do
+ before :all do
@config_dir = File.join(File.dirname(__FILE__), "test_config")
end
it "loads from defaults" do
config = Profigure.load @config_dir
@@ -58,7 +58,30 @@
it "should allow template to contain erb" do
config = Profigure.load @config_dir, "erb"
config[:user].should == ENV["USER"]
+ end
+
+ context "profiguring like another yml" do
+ before :all do
+ @config = Profigure.load @config_dir, "like_nested"
+ end
+
+ it "should have the default settings" do
+ @config.foo.should == "bar"
+ end
+
+ it "should have settings it's file" do
+ @config.new_config.should == "yes_i_am"
+ end
+
+ it "should have settings from config referenced by 'profigure_like'" do
+ @config.marco.should == "polo"
+ end
+
+ it "should override configs from refrerenced with actual file" do
+ @config.top_level.second_level.third_level.bar.should == "foo"
+ end
+
end
end