spec/lib/ruby-conf_spec.rb in ruby-conf-1.3.0 vs spec/lib/ruby-conf_spec.rb in ruby-conf-1.4.0
- old
+ new
@@ -62,9 +62,25 @@
end
end
MyConfig.turtles.mutant.should == true
MyConfig.turtles.raphael.mask.should == "red"
end
+ describe "RubyConf" do
+ it "can access configs using square brackets" do
+ subject.define "config" do
+ shredder "villain"
+ end
+ subject[:config].shredder.should == "villain"
+ end
+ end
+ describe "RubyConf::Config" do
+ it "can access attributes using square brackets" do
+ subject.define "config" do
+ splinter "the man"
+ end
+ subject[:config][:splinter].should == "the man"
+ end
+ end
it "defines a new configuration with a given name" do
subject.define "thing" do end
subject.should respond_to(:thing)
end
it "sets a variable in new configuration with a given name to a value" do