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