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:
parent
ac40d671b8
commit
6838722e95
2 changed files with 11 additions and 0 deletions
2
sinatra-contrib/spec/config_file/key_value_override.yml
Normal file
2
sinatra-contrib/spec/config_file/key_value_override.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
foo: foo
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue