Sha256: b40f5625fdd9bda58d6b7e2699b50e235ba4240331b11da9c7f08af690b8661b

Contents?: true

Size: 722 Bytes

Versions: 10

Compression:

Stored size: 722 Bytes

Contents

require 'spec_helper'
require 'gemirro/mirror_directory'
require 'gemirro/cache'

# Gem tests
module Gemirro
  describe 'Cache' do
    include FakeFS::SpecHelpers
    before(:each) do
      MirrorDirectory.new('/tmp')
      @cache = Cache.new('/tmp')
    end

    it 'should play with flush key' do
      @cache.cache('foo') do
        'something'
      end
      expect(@cache.cache('foo')).to eq('something')
      @cache.flush_key('foo')
      expect(@cache.cache('foo')).to be_nil
    end

    it 'should play with flush' do
      @cache.cache('foo') do
        'something'
      end
      expect(@cache.cache('foo')).to eq('something')
      @cache.flush
      expect(@cache.cache('foo')).to be_nil
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gemirro-1.5.0 spec/gemirro/cache_spec.rb
gemirro-1.4.0 spec/gemirro/cache_spec.rb
gemirro-1.3.0 spec/gemirro/cache_spec.rb
gemirro-1.2.0 spec/gemirro/cache_spec.rb
gemirro-1.1.1 spec/gemirro/cache_spec.rb
gemirro-1.1.0 spec/gemirro/cache_spec.rb
gemirro-1.0.0 spec/gemirro/cache_spec.rb
gemirro-0.16.0 spec/gemirro/cache_spec.rb
gemirro-0.15.0 spec/gemirro/cache_spec.rb
gemirro-0.14.0 spec/gemirro/cache_spec.rb