Commit d9519573 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve config specs so they dont rely on config.yml

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent a47f7767
...@@ -5,20 +5,27 @@ describe GitlabConfig do ...@@ -5,20 +5,27 @@ describe GitlabConfig do
let(:config) { GitlabConfig.new } let(:config) { GitlabConfig.new }
describe :redis do describe :redis do
subject { config.redis } before do
config.instance_variable_set(:@config, YAML.load(<<eos
it { should be_a(Hash) } redis:
it { should have_key('bin') } bin: /usr/bin/redis-cli
it { should have_key('host') } host: 127.0.1.1
it { should have_key('port') } port: 6378
it { should have_key('database') } pass: secure
it { should have_key('namespace') } database: 1
end socket: /var/run/redis/redis.sock
namespace: my:gitlab
describe :redis_namespace do eos
subject { config.redis_namespace } ))
end
it { should eq('resque:gitlab') } it { config.redis['bin'].should eq('/usr/bin/redis-cli') }
it { config.redis['host'].should eq('127.0.1.1') }
it { config.redis['port'].should eq(6378) }
it { config.redis['database'].should eq(1) }
it { config.redis['namespace'].should eq('my:gitlab') }
it { config.redis['socket'].should eq('/var/run/redis/redis.sock') }
it { config.redis['pass'].should eq('secure') }
end end
describe :gitlab_url do describe :gitlab_url do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment