Browse files

speccing memcached namespace awareness of metastore and entitystore

  • Loading branch information...
1 parent 161d772 commit c01c325311fe77111d1703eb3bf0c043ff3099e5 @atzkey atzkey committed Aug 14, 2011
Showing with 10 additions and 0 deletions.
  1. +5 −0 test/entitystore_test.rb
  2. +5 −0 test/metastore_test.rb
View
5 test/entitystore_test.rb
@@ -190,6 +190,11 @@ def sha_like?
memcached = Rack::Cache::EntityStore::MemCached.resolve URI.parse("memcached://#{ENV['MEMCACHED']}?show_backtraces=true")
memcached.cache.instance_variable_get(:@options)[:show_backtraces].should.equal true
end
+
+ it 'takes namespace into account' do
+ memcached = Rack::Cache::EntityStore::MemCached.resolve URI.parse("memcached://#{ENV['MEMCACHED']}/obj_ns1?show_backtraces=true")
+ memcached.cache.instance_variable_get(:@options)[:prefix_key].should.equal 'obj_ns1'
+ end
end
View
5 test/metastore_test.rb
@@ -270,6 +270,11 @@ def self.call(request); request.path_info.reverse end
memcached = Rack::Cache::MetaStore::MemCached.resolve URI.parse("memcached://#{ENV['MEMCACHED']}?show_backtraces=true")
memcached.cache.instance_variable_get(:@options)[:show_backtraces].should.equal true
end
+
+ it 'takes namespace into account' do
+ memcached = Rack::Cache::MetaStore::MemCached.resolve URI.parse("memcached://#{ENV['MEMCACHED']}/meta_ns1?show_backtraces=true")
+ memcached.cache.instance_variable_get(:@options)[:prefix_key].should.equal 'meta_ns1'
+ end
end
need_dalli 'metastore tests' do

0 comments on commit c01c325

Please sign in to comment.