require_relative'../../lib/repository_cache'describeRepositoryCachedolet(:backend){double('backend').as_null_object}let(:cache){RepositoryCache.new('example',backend)}describe'#cache_key'doit'includes the namespace'doexpect(cache.cache_key(:foo)).toeq'foo:example'endenddescribe'#expire'doit'expires the given key from the cache'docache.expire(:foo)expect(backend).tohave_received(:delete).with('foo:example')endenddescribe'#fetch'doit'fetches the given key from the cache'docache.fetch(:bar)expect(backend).tohave_received(:fetch).with('bar:example')endit'accepts a block'dop=->{}cache.fetch(:baz,&p)expect(backend).tohave_received(:fetch).with('baz:example',&p)endendend