spec/nanoc/base/views/item_view_spec.rb in nanoc-4.6.1 vs spec/nanoc/base/views/item_view_spec.rb in nanoc-4.6.2

- old
+ new

@@ -32,14 +32,17 @@ end let(:view) { described_class.new(item, view_context) } let(:items) do - Nanoc::Int::IdentifiableCollection.new({}).tap do |arr| - arr << item - arr << parent_item if parent_item - end + Nanoc::Int::IdentifiableCollection.new( + {}, + [ + item, + parent_item, + ].compact, + ) end subject { view.parent } context 'with parent' do @@ -128,14 +131,17 @@ end let(:view) { described_class.new(item, view_context) } let(:items) do - Nanoc::Int::IdentifiableCollection.new({}).tap do |arr| - arr << item - children.each { |child| arr << child } - end + Nanoc::Int::IdentifiableCollection.new( + {}, + [ + item, + *children, + ], + ) end subject { view.children } context 'full identifier' do @@ -206,14 +212,14 @@ let(:rep) do Nanoc::Int::ItemRep.new(item, :default).tap do |ir| ir.compiled = true ir.snapshot_defs = [ - Nanoc::Int::SnapshotDef.new(:last), - Nanoc::Int::SnapshotDef.new(:pre), - Nanoc::Int::SnapshotDef.new(:post), - Nanoc::Int::SnapshotDef.new(:specific), + Nanoc::Int::SnapshotDef.new(:last, binary: false), + Nanoc::Int::SnapshotDef.new(:pre, binary: false), + Nanoc::Int::SnapshotDef.new(:post, binary: false), + Nanoc::Int::SnapshotDef.new(:specific, binary: false), ] end end before do @@ -284,11 +290,11 @@ end let(:rep) do Nanoc::Int::ItemRep.new(item, :default).tap do |ir| ir.paths = { - last: '/about/', - specific: '/about.txt', + last: ['/about/'], + specific: ['/about.txt'], } end end context 'requesting implicit default rep' do