summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-16 10:09:16 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-09-16 10:09:16 +0300
commitd951957348db442399c257e4fdcd55200b3316c6 (patch)
tree541817f85e00cd02af8dc6e21d1354e43cd5df41
parenta47f7767c7f2a33258002649a08689f03d4c01b8 (diff)
downloadgitlab-shell-d951957348db442399c257e4fdcd55200b3316c6.tar.gz
Improve config specs so they dont rely on config.yml
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--spec/gitlab_config_spec.rb33
1 files changed, 20 insertions, 13 deletions
diff --git a/spec/gitlab_config_spec.rb b/spec/gitlab_config_spec.rb
index d2b4776..5c56540 100644
--- a/spec/gitlab_config_spec.rb
+++ b/spec/gitlab_config_spec.rb
@@ -5,20 +5,27 @@ describe GitlabConfig do
let(:config) { GitlabConfig.new }
describe :redis do
- subject { config.redis }
-
- it { should be_a(Hash) }
- it { should have_key('bin') }
- it { should have_key('host') }
- it { should have_key('port') }
- it { should have_key('database') }
- it { should have_key('namespace') }
- end
-
- describe :redis_namespace do
- subject { config.redis_namespace }
+ before do
+ config.instance_variable_set(:@config, YAML.load(<<eos
+redis:
+ bin: /usr/bin/redis-cli
+ host: 127.0.1.1
+ port: 6378
+ pass: secure
+ database: 1
+ socket: /var/run/redis/redis.sock
+ namespace: my:gitlab
+eos
+ ))
+ 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
describe :gitlab_url do