spec/lib/ruby-conf_spec.rb in ruby-conf-0.1.0 vs spec/lib/ruby-conf_spec.rb in ruby-conf-1.0.1
- old
+ new
@@ -12,11 +12,21 @@
#RubyConf.namespace.thingy
describe RubyConf do
subject { RubyConf }
-
+
describe ".define" do
+ context ":as" do
+ it "creates a global Constant" do
+ subject.define "rails_database", :as => :RailsDatabase do
+ production :host => 'localhost', :password => 'cake', :username => 'eggs2legit'
+ end
+ ::RailsDatabase.production[:host].should == 'localhost'
+ ::RailsDatabase.production[:username].should_not be_nil
+ ::RailsDatabase.production[:password].should_not be_nil
+ 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