Sha256: d58924c999ebedd397158444cd60154a78e0d7540bc840ac27c22df8aba4f85a

Contents?: true

Size: 875 Bytes

Versions: 116

Compression:

Stored size: 875 Bytes

Contents

# frozen_string_literal: true

require 'active_support/core_ext/object/blank'
require 'eac_ruby_utils/filesystem_cache'

RSpec.describe ::EacRubyUtils::FilesystemCache do
  let(:tmpdir) { ::Dir.mktmpdir }
  let(:instance) { described_class.new(tmpdir, 'instance') }

  it { expect(instance.read).to be_blank }
  it { expect(instance.cached?).to eq(false) }

  context 'when instance is writed' do
    before { instance.write('STUB') }

    it { expect(instance.read).to eq('STUB') }
    it { expect(instance.cached?).to eq(true) }

    context 'when instance is cleared' do
      before { instance.clear }

      it { expect(instance.read).to be_blank }
      it { expect(instance.cached?).to eq(false) }
    end
  end

  describe '#child' do
    let(:child) { instance.child('child') }

    it { expect(child.path).to match(/\A#{::Regexp.quote(instance.path)}/) }
  end
end

Version data entries

116 entries across 116 versions & 2 rubygems

Version Path
avm-tools-0.106.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
ehbrs-tools-0.27.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
ehbrs-tools-0.26.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.105.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
ehbrs-tools-0.25.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
ehbrs-tools-0.25.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
ehbrs-tools-0.24.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.104.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
ehbrs-tools-0.23.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
ehbrs-tools-0.23.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.103.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.103.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
ehbrs-tools-0.22.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.102.2 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.102.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.102.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.101.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.100.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
ehbrs-tools-0.21.0 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb
avm-tools-0.99.1 vendor/eac_ruby_utils/spec/lib/eac_ruby_utils/filesystem_cache_spec.rb