Sha256: 371d1f06af237472c621d5eb70558cbd6d89f8231e665c17ad334e8501fe7e9c
Contents?: true
Size: 1.23 KB
Versions: 1
Compression:
Stored size: 1.23 KB
Contents
require "spec_helper" module RockConfig describe Config do it "accepts a hash" do hash = {:foo => "bar"} config = Config.new(hash) config.raw.should eq(hash) end it "returns config for given environment" do subhash_dev = {"a" => 123} subhash_prod = {"a" => 321} hash = { "development" => subhash_dev, "production" => subhash_prod } config = Config.new(hash) config.development.raw.should eq(subhash_dev) config.production.raw.should eq(subhash_prod) end it "returns nil when asked for non existing environment" do config = Config.new({}) config.for_environment("I do not exist").should be_nil end it "returns correct values when asked for" do hash = { "development" => { "host" => "localhost" } } config = Config.new(hash) config.development.host.should eq("localhost") end it "returns correct nested values when asked for" do hash = { "development" => { "elastic" => { "host" => "localhost" } } } config = Config.new(hash) config.development.elastic.host.should eq("localhost") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rock_config-0.0.3 | spec/config_spec.rb |