2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 09:10:25 +08:00

FEATURE: allow for additional plugin defined global settings

This commit is contained in:
Sam 2014-01-02 10:46:09 +11:00
parent 6a0072d36e
commit 2ad190b9f6
2 changed files with 29 additions and 4 deletions

View file

@ -1,6 +1,12 @@
require 'spec_helper'
require 'tempfile'
describe GlobalSetting::EnvProvider do
it "can detect keys from env" do
ENV['DISCOURSE_BLA'] = '1'
GlobalSetting::EnvProvider.new.keys.should include(:bla)
end
end
describe GlobalSetting::FileProvider do
it "can parse a simple file" do
f = Tempfile.new('foo')
@ -20,6 +26,9 @@ describe GlobalSetting::FileProvider do
provider.lookup(:d,"bob").should == nil
provider.lookup(:e,"bob").should == "bob"
provider.keys.sort.should == [:a, :b, :c, :d]
f.unlink
end
end