Sha256: b3980752ae7884989cda31690f5aef48e1367aa3396781d5d868b7979f2fc984
Contents?: true
Size: 1.34 KB
Versions: 1
Compression:
Stored size: 1.34 KB
Contents
require 'spec_helper' describe EasyRedis::Redis do context 'redis method' do it 'should return nil object if redis did not setted' do expect(EasyRedis::Redis.redis).to eql(nil) end it 'should return nil object if redis did not setted' do redis = Redis.new EasyRedis::Redis.configure(redis: redis) expect(EasyRedis::Redis.redis).to eql(redis) end end context 'redis setter method' do it 'should set redis as param' do redis = Redis.new EasyRedis::Redis.redis = redis expect(EasyRedis::Redis.redis).to eql(redis) end end context 'namespace method' do it 'should return easyredis by default if namespace did not setted' do expect(EasyRedis::Redis.namespace).to eql('easyredis') end it 'should return setted namespace if namespace setted' do EasyRedis::Redis.configure(namespace: "namespace") expect(EasyRedis::Redis.namespace).to eql('namespace') end end context 'raise_non_existent_object_error? method' do it 'should return true by default' do expect(EasyRedis::Redis.raise_non_existent_object_error?).to eql(true) end it 'should return false if setted as false' do EasyRedis::Redis.configure(raise_non_existent_object_error: false) expect(EasyRedis::Redis.raise_non_existent_object_error?).to eql(false) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
easy_redis-0.1.0 | spec/lib/easy_redis/easy_redis_spec.rb |