diff --git a/lib/nesta/config.rb b/lib/nesta/config.rb index 758bca36..93cf548a 100644 --- a/lib/nesta/config.rb +++ b/lib/nesta/config.rb @@ -91,7 +91,7 @@ def self.yaml_exists? private_class_method :yaml_exists? def self.can_use_yaml? - ENV.keys.grep(/^NESTA/).empty? && yaml_exists? + yaml_exists? end private_class_method :can_use_yaml? diff --git a/spec/config_spec.rb b/spec/config_spec.rb index a9437db3..66886d20 100644 --- a/spec/config_spec.rb +++ b/spec/config_spec.rb @@ -18,10 +18,10 @@ @title = "Title from ENV" ENV["NESTA_TITLE"] = @title end - - it "should never try and access config.yml" do + + it "should fallback to config.yml" do stub_config_key("subtitle", "Subtitle in YAML file") - Nesta::Config.subtitle.should be_nil + Nesta::Config.subtitle.should == "Subtitle in YAML file" end it "should override config.yml" do