spec/confstruct/configuration_spec.rb in confstruct-0.2.0 vs spec/confstruct/configuration_spec.rb in confstruct-0.2.1

- old
+ new

@@ -6,9 +6,19 @@ conf = Confstruct::Configuration.new conf.is_a?(Hash).should be_true conf.is_a?(Confstruct::Configuration).should be_true conf.should == {} end + + it "should initialize properly from a nested hash with string keys" do + x = { 'a' => { 'b' => 'c' } } + conf = Confstruct::Configuration.new(x) + conf.is_a?(Hash).should be_true + conf.is_a?(Confstruct::Configuration).should be_true + conf[:a][:b].should == 'c' + conf['a']['b'].should == 'c' + conf.a.b.should == 'c' + end context "default values" do before :all do @defaults = { :project => 'confstruct',