test/base/test_item_rep.rb in nanoc-4.0.0b4 vs test/base/test_item_rep.rb in nanoc-4.0.0rc1
- old
+ new
@@ -1,13 +1,13 @@
class Nanoc::Int::ItemRepTest < Nanoc::TestCase
def test_compiled_content_with_only_last_available
# Create rep
item = Nanoc::Int::Item.new(
- 'blah blah blah', {}, '/',
+ 'blah blah blah', {}, '/'
)
rep = Nanoc::Int::ItemRep.new(item, nil)
- rep.content_snapshots = {
+ rep.snapshot_contents = {
last: Nanoc::Int::TextualContent.new('last content'),
}
rep.expects(:compiled?).returns(true)
# Check
@@ -15,14 +15,14 @@
end
def test_compiled_content_with_pre_and_last_available
# Create rep
item = Nanoc::Int::Item.new(
- 'blah blah blah', {}, '/',
+ 'blah blah blah', {}, '/'
)
rep = Nanoc::Int::ItemRep.new(item, nil)
- rep.content_snapshots = {
+ rep.snapshot_contents = {
pre: Nanoc::Int::TextualContent.new('pre content'),
last: Nanoc::Int::TextualContent.new('last content'),
}
rep.expects(:compiled?).returns(true)
@@ -31,14 +31,14 @@
end
def test_compiled_content_with_custom_snapshot
# Create rep
item = Nanoc::Int::Item.new(
- 'blah blah blah', {}, '/',
+ 'blah blah blah', {}, '/'
)
rep = Nanoc::Int::ItemRep.new(item, nil)
- rep.content_snapshots = {
+ rep.snapshot_contents = {
pre: Nanoc::Int::TextualContent.new('pre content'),
last: Nanoc::Int::TextualContent.new('last content'),
}
rep.expects(:compiled?).returns(true)
@@ -47,14 +47,14 @@
end
def test_compiled_content_with_invalid_snapshot
# Create rep
item = Nanoc::Int::Item.new(
- 'blah blah blah', {}, '/',
+ 'blah blah blah', {}, '/'
)
rep = Nanoc::Int::ItemRep.new(item, nil)
- rep.content_snapshots = {
+ rep.snapshot_contents = {
pre: Nanoc::Int::TextualContent.new('pre content'),
last: Nanoc::Int::TextualContent.new('last content'),
}
# Check
@@ -64,11 +64,11 @@
end
def test_compiled_content_with_uncompiled_content
# Create rep
item = Nanoc::Int::Item.new(
- 'blah blah', {}, '/',
+ 'blah blah', {}, '/'
)
rep = Nanoc::Int::ItemRep.new(item, nil)
rep.expects(:compiled?).returns(false)
# Check
@@ -78,15 +78,15 @@
end
def test_compiled_content_with_moving_pre_snapshot
# Create rep
item = Nanoc::Int::Item.new(
- 'blah blah', {}, '/',
+ 'blah blah', {}, '/'
)
rep = Nanoc::Int::ItemRep.new(item, nil)
rep.expects(:compiled?).returns(false)
- rep.content_snapshots = {
+ rep.snapshot_contents = {
pre: Nanoc::Int::TextualContent.new('pre!'),
last: Nanoc::Int::TextualContent.new('last!'),
}
# Check
@@ -96,15 +96,17 @@
end
def test_compiled_content_with_non_moving_pre_snapshot
# Create rep
item = Nanoc::Int::Item.new(
- 'blah blah', {}, '/',
+ 'blah blah', {}, '/'
)
rep = Nanoc::Int::ItemRep.new(item, nil)
rep.expects(:compiled?).returns(false)
- rep.snapshots = [[:pre, true]]
- rep.content_snapshots = {
+ rep.snapshot_defs = [
+ Nanoc::Int::SnapshotDef.new(:pre, true),
+ ]
+ rep.snapshot_contents = {
pre: Nanoc::Int::TextualContent.new('pre!'),
post: Nanoc::Int::TextualContent.new('post!'),
last: Nanoc::Int::TextualContent.new('last!'),
}