Sha256: 0c92e26005566f7869a34254f78acb44a6f16ae1e4c5e63507773ac6820c0874

Contents?: true

Size: 839 Bytes

Versions: 14

Compression:

Stored size: 839 Bytes

Contents

# frozen_string_literal: true

require 'active_support/core_ext/object/blank'
require 'eac_fs/cache'

RSpec.describe ::EacFs::Cache 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

14 entries across 14 versions & 2 rubygems

Version Path
avm-tools-0.113.6 sub/eac_fs/spec/lib/eac_fs/cache_spec.rb
avm-tools-0.113.5 sub/eac_fs/spec/lib/eac_fs/cache_spec.rb
avm-tools-0.113.4 sub/eac_fs/spec/lib/eac_fs/cache_spec.rb
avm-tools-0.113.3 sub/eac_fs/spec/lib/eac_fs/cache_spec.rb
avm-tools-0.113.2 sub/eac_fs/spec/lib/eac_fs/cache_spec.rb
ehbrs-tools-0.28.3 vendor/eac_fs/spec/lib/eac_fs/cache_spec.rb
avm-tools-0.110.0 vendor/eac_fs/spec/lib/eac_fs/cache_spec.rb
avm-tools-0.109.1 vendor/eac_fs/spec/lib/eac_fs/cache_spec.rb
avm-tools-0.109.0 vendor/eac_fs/spec/lib/eac_fs/cache_spec.rb
ehbrs-tools-0.28.2 vendor/eac_fs/spec/lib/eac_fs/cache_spec.rb
avm-tools-0.108.0 vendor/eac_fs/spec/lib/eac_fs/cache_spec.rb
ehbrs-tools-0.28.1 vendor/eac_fs/spec/lib/eac_fs/cache_spec.rb
avm-tools-0.107.0 vendor/eac_fs/spec/lib/eac_fs/cache_spec.rb
ehbrs-tools-0.28.0 vendor/eac_fs/spec/lib/eac_fs/cache_spec.rb