test/base/test_item_array.rb in nanoc-4.6.1 vs test/base/test_item_array.rb in nanoc-4.6.2
- old
+ new
@@ -5,13 +5,11 @@
super
@one = Nanoc::Int::Item.new('Item One', {}, '/one/')
@two = Nanoc::Int::Item.new('Item Two', {}, '/two/')
- @items = Nanoc::Int::IdentifiableCollection.new({})
- @items << @one
- @items << @two
+ @items = Nanoc::Int::IdentifiableCollection.new({}, [@one, @two])
end
def test_change_item_identifier
assert_equal @one, @items['/one/']
assert_nil @items['/foo/']
@@ -25,13 +23,11 @@
def test_enumerable
assert_equal @one, @items.find { |i| i.identifier == '/one/' }
end
def test_brackets_with_glob
- @items = Nanoc::Int::IdentifiableCollection.new(string_pattern_type: 'glob')
- @items << @one
- @items << @two
+ @items = Nanoc::Int::IdentifiableCollection.new({ string_pattern_type: 'glob' }, [@one, @two])
assert_equal @one, @items['/on*/']
assert_equal @two, @items['/*wo/']
end
@@ -55,27 +51,20 @@
assert_nil @items['/tenthousand/']
end
def test_regex
foo = Nanoc::Int::Item.new('Item Foo', {}, '/foo/')
- @items << foo
+ @items = Nanoc::Int::IdentifiableCollection.new({}, [@one, @two, foo])
assert_equal @one, @items[/n/]
assert_equal @two, @items[%r{o/}] # not foo
end
def test_less_than_less_than
assert_nil @items['/foo/']
foo = Nanoc::Int::Item.new('Item Foo', {}, '/foo/')
- @items << foo
+ @items = Nanoc::Int::IdentifiableCollection.new({}, [@one, @two, foo])
assert_equal foo, @items['/foo/']
- end
-
- def test_concat
- new_item = Nanoc::Int::Item.new('New item', {}, '/new/')
- @items.concat([new_item])
-
- assert_equal new_item, @items['/new/']
end
end