1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

add a example for multiple config files

This commit is contained in:
Gabriel Andretta 2011-09-29 21:58:23 -03:00
parent ac40d671b8
commit 6838722e95
2 changed files with 11 additions and 0 deletions

View file

@ -0,0 +1,2 @@
---
foo: foo

View file

@ -41,4 +41,13 @@ describe Sinatra::ConfigFile do
config_file('missing_env.yml') { set :foo => 42, :environment => :test }
settings.foo.should == 42
end
it 'should prioritize settings in latter files' do
# first let's check the test is actually working properly
config_file 'key_value.yml'
settings.foo.should == 'bar'
# now test it
config_file 'key_value_override.yml'
settings.foo.should == 'foo'
end
end