spec/nanoc/base/services/outdatedness_checker_spec.rb in nanoc-4.7.11 vs spec/nanoc/base/services/outdatedness_checker_spec.rb in nanoc-4.7.12

- old
+ new

@@ -23,11 +23,11 @@ config: config, ).run end let(:dependency_store) do - Nanoc::Int::DependencyStore.new(items, layouts) + Nanoc::Int::DependencyStore.new(items, layouts, config) end let(:items) { Nanoc::Int::IdentifiableCollection.new(config, [item]) } let(:layouts) { Nanoc::Int::IdentifiableCollection.new(config) } @@ -318,9 +318,49 @@ b.add_filter(:erb, {}) b.add_snapshot(:donkey, '/giraffe.txt') end end + it { is_expected.not_to be } + end + end + + context 'generic dependency on config' do + before do + dependency_store.record_dependency(item, config, attributes: true) + end + + context 'nothing changed' do + it { is_expected.not_to be } + end + + context 'attribute changed' do + before { config[:title] = 'omg new title' } + it { is_expected.to be } + end + + context 'other attribute changed' do + before { config[:subtitle] = 'tagline here' } + it { is_expected.to be } + end + end + + context 'specific dependency on config' do + before do + dependency_store.record_dependency(item, config, attributes: [:title]) + end + + context 'nothing changed' do + it { is_expected.not_to be } + end + + context 'attribute changed' do + before { config[:title] = 'omg new title' } + it { is_expected.to be } + end + + context 'other attribute changed' do + before { config[:subtitle] = 'tagline here' } it { is_expected.not_to be } end end context 'only raw content dependency' do