Sha256: 1f8c57a34ec480c6042667f2f75cee365bc678eb4a488728815d5c053bde18d6

Contents?: true

Size: 746 Bytes

Versions: 5

Compression:

Stored size: 746 Bytes

Contents

# -*- coding: utf-8 -*-
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

5 entries across 5 versions & 1 rubygems

Version Path
gemirro-0.13.5 spec/gemirro/cache_spec.rb
gemirro-0.13.4 spec/gemirro/cache_spec.rb
gemirro-0.13.3 spec/gemirro/cache_spec.rb
gemirro-0.13.2 spec/gemirro/cache_spec.rb
gemirro-0.13.1 spec/gemirro/cache_spec.rb