spec/lib/ruby-conf_spec.rb in ruby-conf-1.0.1 vs spec/lib/ruby-conf_spec.rb in ruby-conf-1.1.0
- old
+ new
@@ -24,9 +24,23 @@
::RailsDatabase.production[:host].should == 'localhost'
::RailsDatabase.production[:username].should_not be_nil
::RailsDatabase.production[:password].should_not be_nil
end
end
+ it "returns a config" do
+ config = subject.define "config" do
+ something "hi"
+ end
+ config.something.should == "hi"
+ end
+ it "can be chained" do
+ subject.define "config", :as => :MyConfig do
+ love_song (RubyConf.define "love_song" do
+ title "in me all along"
+ end)
+ end
+ MyConfig.love_song.title.should == 'in me all along'
+ 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