Skip to content
Browse files

Issue 128|fixing entitystore is not namespaced (#128) and adding test…

…s for both metastore and entitystore namespaces
  • Loading branch information...
1 parent 6644a83 commit 839ed5544f76012f9b8c18e7f0232b3a616bc609 @jtblin jtblin committed
View
2 redis-rack-cache/lib/rack/cache/redis_entitystore.rb
@@ -21,7 +21,7 @@ def self.resolve(uri)
class Redis < RedisBase
def initialize(server, options = {})
- @cache = ::Redis.new server
+ @cache = ::Redis::Factory.create(server)
end
def exist?(key)
View
3 redis-rack-cache/test/rack/cache/entitystore/redis_test.rb
@@ -29,6 +29,9 @@ def sha_like?
cache = ::Rack::Cache::EntityStore::Redis.resolve(uri("redis://:secret@127.0.0.1")).cache
cache.id.must_equal("redis://127.0.0.1:6379/0")
cache.client.password.must_equal('secret')
+
+ cache = Rack::Cache::MetaStore::Redis.resolve(uri("redis://127.0.0.1:6380/0/entitystore")).cache
+ cache.to_s.must_equal("Redis Client connected to 127.0.0.1:6380 against DB 0 with namespace entitystore")
end
it 'responds to all required messages' do
View
3 redis-rack-cache/test/rack/cache/metastore/redis_test.rb
@@ -35,6 +35,9 @@
cache = Rack::Cache::MetaStore::Redis.resolve(uri("redis://:secret@127.0.0.1")).cache
cache.id.must_equal("redis://127.0.0.1:6379/0")
cache.client.password.must_equal('secret')
+
+ cache = Rack::Cache::MetaStore::Redis.resolve(uri("redis://127.0.0.1:6380/0/metastore")).cache
+ cache.to_s.must_equal("Redis Client connected to 127.0.0.1:6380 against DB 0 with namespace metastore")
end
# Low-level implementation methods ===========================================

0 comments on commit 839ed55

Please sign in to comment.
Something went wrong with that request. Please try again.