spec/nanoc/base/services/outdatedness_checker_spec.rb in nanoc-4.7.4 vs spec/nanoc/base/services/outdatedness_checker_spec.rb in nanoc-4.7.5
- old
+ new
@@ -3,11 +3,11 @@
described_class.new(
site: site,
checksum_store: checksum_store,
dependency_store: dependency_store,
action_sequence_store: action_sequence_store,
- action_provider: action_provider,
+ action_sequences: action_sequences,
reps: reps,
)
end
let(:checksum_store) { double(:checksum_store) }
@@ -36,11 +36,13 @@
end
end
let(:new_action_sequence_for_item_rep) { old_action_sequence_for_item_rep }
- let(:action_provider) { double(:action_provider) }
+ let(:action_sequences) do
+ { item_rep => new_action_sequence_for_item_rep }
+ end
let(:reps) do
Nanoc::Int::ItemRepRepo.new
end
@@ -50,16 +52,14 @@
let(:objects) { [item] }
before do
reps << item_rep
action_sequence_store[item_rep] = old_action_sequence_for_item_rep.serialize
-
- allow(action_provider).to receive(:action_sequence_for).with(item_rep).and_return(new_action_sequence_for_item_rep)
end
- describe '#basic_outdatedness_reason_for' do
- subject { outdatedness_checker.send(:basic_outdatedness_reason_for, obj) }
+ describe 'basic outdatedness reasons' do
+ subject { outdatedness_checker.send(:basic).outdatedness_status_for(obj).reasons.first }
let(:checksum_store) { Nanoc::Int::ChecksumStore.new(objects: objects) }
let(:config) { Nanoc::Int::Configuration.new }
@@ -129,30 +129,43 @@
end
end
let(:new_action_sequence_for_other_item_rep) { old_action_sequence_for_other_item_rep }
+ let(:action_sequences) do
+ {
+ item_rep => new_action_sequence_for_item_rep,
+ other_item_rep => new_action_sequence_for_other_item_rep,
+ }
+ end
+
before do
reps << other_item_rep
action_sequence_store[other_item_rep] = old_action_sequence_for_other_item_rep.serialize
checksum_store.add(item)
checksum_store.add(other_item)
checksum_store.add(config)
- allow(action_provider).to receive(:action_sequence_for).with(other_item_rep).and_return(new_action_sequence_for_other_item_rep)
allow(site).to receive(:code_snippets).and_return([])
allow(site).to receive(:config).and_return(config)
end
context 'transitive dependency' do
let(:distant_item) { Nanoc::Int::Item.new('distant stuff', {}, '/distant.md') }
let(:distant_item_rep) { Nanoc::Int::ItemRep.new(distant_item, :default) }
+ let(:action_sequences) do
+ {
+ item_rep => new_action_sequence_for_item_rep,
+ other_item_rep => new_action_sequence_for_other_item_rep,
+ distant_item_rep => new_action_sequence_for_other_item_rep,
+ }
+ end
+
before do
reps << distant_item_rep
checksum_store.add(distant_item)
action_sequence_store[distant_item_rep] = old_action_sequence_for_other_item_rep.serialize
- allow(action_provider).to receive(:action_sequence_for).with(distant_item_rep).and_return(new_action_sequence_for_other_item_rep)
end
context 'on attribute + attribute' do
before do
dependency_store.record_dependency(item, other_item, attributes: true)