Sha256: 48b33080993ada4dba498308cdb6d2484ec91f7dfa5380e295f0cab186a5f425
Contents?: true
Size: 1.45 KB
Versions: 3
Compression:
Stored size: 1.45 KB
Contents
# frozen_string_literal: true describe Nanoc::Int::OutdatednessStore do subject(:store) { described_class.new(site: site) } let(:site) { double(:site) } let(:item) { Nanoc::Int::Item.new('foo', {}, '/foo.md') } let(:rep) { Nanoc::Int::ItemRep.new(item, :foo) } let(:site) do Nanoc::Int::Site.new( config: config, code_snippets: code_snippets, data_source: Nanoc::Int::InMemDataSource.new(items, layouts), ) end let(:config) { Nanoc::Int::Configuration.new.with_defaults } let(:items) { [] } let(:layouts) { [] } let(:code_snippets) { [] } describe '#include?, #add and #remove' do subject { store.include?(rep) } context 'nothing added' do it { is_expected.not_to be } end context 'rep added' do before { store.add(rep) } it { is_expected.to be } end context 'rep added and removed' do before do store.add(rep) store.remove(rep) end it { is_expected.not_to be } end context 'rep added, removed, and added again' do before do store.add(rep) store.remove(rep) store.add(rep) end it { is_expected.to be } end end describe 'reloading' do subject do store.store store.load store.include?(rep) end context 'not added' do it { is_expected.not_to be } end context 'added' do before { store.add(rep) } it { is_expected.to be } end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
nanoc-4.8.12 | spec/nanoc/base/repos/outdatedness_store_spec.rb |
nanoc-4.8.11 | spec/nanoc/base/repos/outdatedness_store_spec.rb |
nanoc-4.8.10 | spec/nanoc/base/repos/outdatedness_store_spec.rb |