Sha256: b70661bf0dde432f5ce34489a4ef990ebb785ae97581a2fcf0473ad148b11c27
Contents?: true
Size: 1.78 KB
Versions: 2
Compression:
Stored size: 1.78 KB
Contents
describe Nanoc::Int::Compiler::Stages::CalculateChecksums do let(:stage) do described_class.new(items: items, layouts: layouts, code_snippets: code_snippets, config: config) end let(:config) do Nanoc::Int::Configuration.new.with_defaults end let(:code_snippets) do [code_snippet] end let(:items) do Nanoc::Int::IdentifiableCollection.new(config, [item]) end let(:layouts) do Nanoc::Int::IdentifiableCollection.new(config, [layout]) end let(:code_snippet) do Nanoc::Int::CodeSnippet.new('woof!', 'dog.rb') end let(:item) do Nanoc::Int::Item.new('hello there', {}, '/hi.md') end let(:layout) do Nanoc::Int::Layout.new('t3mpl4t3', {}, '/page.erb') end describe '#run' do subject { stage.run } it 'checksums items' do expect(subject.checksum_for(item)) .to eq(Nanoc::Int::Checksummer.calc(item)) expect(subject.content_checksum_for(item)) .to eq(Nanoc::Int::Checksummer.calc_for_content_of(item)) expect(subject.attributes_checksum_for(item)) .to eq(Nanoc::Int::Checksummer.calc_for_each_attribute_of(item)) end it 'checksums layouts' do expect(subject.checksum_for(layout)) .to eq(Nanoc::Int::Checksummer.calc(layout)) expect(subject.content_checksum_for(layout)) .to eq(Nanoc::Int::Checksummer.calc_for_content_of(layout)) expect(subject.attributes_checksum_for(layout)) .to eq(Nanoc::Int::Checksummer.calc_for_each_attribute_of(layout)) end it 'checksums config' do expect(subject.checksum_for(config)) .to eq(Nanoc::Int::Checksummer.calc(config)) end it 'checksums code snippets' do expect(subject.checksum_for(code_snippet)) .to eq(Nanoc::Int::Checksummer.calc(code_snippet)) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
nanoc-4.7.9 | spec/nanoc/base/services/compiler/stages/calculate_checksums_spec.rb |
nanoc-4.7.8 | spec/nanoc/base/services/compiler/stages/calculate_checksums_spec.rb |