test/base/test_data_source.rb in nanoc-4.3.8 vs test/base/test_data_source.rb in nanoc-4.4.0
- old
+ new
@@ -38,15 +38,37 @@
assert_equal 'Stuff!', item.attributes[:title]
assert_equal Nanoc::Identifier.new('/asdf/'), item.identifier
assert_equal 'abcdef', item.checksum_data
end
+ def test_new_item_with_checksums
+ data_source = Nanoc::DataSource.new(nil, nil, nil, nil)
+
+ item = data_source.new_item('stuff', { title: 'Stuff!' }, '/asdf/', content_checksum_data: 'con-cs', attributes_checksum_data: 'attr-cs')
+ assert_equal 'stuff', item.content.string
+ assert_equal 'Stuff!', item.attributes[:title]
+ assert_equal Nanoc::Identifier.new('/asdf/'), item.identifier
+ assert_equal 'con-cs', item.content_checksum_data
+ assert_equal 'attr-cs', item.attributes_checksum_data
+ end
+
def test_new_layout
data_source = Nanoc::DataSource.new(nil, nil, nil, nil)
layout = data_source.new_layout('stuff', { title: 'Stuff!' }, '/asdf/', checksum_data: 'abcdef')
assert_equal 'stuff', layout.content.string
assert_equal 'Stuff!', layout.attributes[:title]
assert_equal Nanoc::Identifier.new('/asdf/'), layout.identifier
assert_equal 'abcdef', layout.checksum_data
+ end
+
+ def test_new_layout_with_checksums
+ data_source = Nanoc::DataSource.new(nil, nil, nil, nil)
+
+ layout = data_source.new_layout('stuff', { title: 'Stuff!' }, '/asdf/', content_checksum_data: 'con-cs', attributes_checksum_data: 'attr-cs')
+ assert_equal 'stuff', layout.content.string
+ assert_equal 'Stuff!', layout.attributes[:title]
+ assert_equal Nanoc::Identifier.new('/asdf/'), layout.identifier
+ assert_equal 'con-cs', layout.content_checksum_data
+ assert_equal 'attr-cs', layout.attributes_checksum_data
end
end