Skip to content

Commit 5a4d8d6

Browse files
committed
Add coverage for empty lists.
1 parent a5779eb commit 5a4d8d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/async/list.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ def initialize(value)
131131
end
132132

133133
with '#first' do
134+
it "returns nil for an empty list" do
135+
expect(list.first).to be_nil
136+
end
137+
134138
it "can return the first item" do
135139
item = Item.new(1)
136140

@@ -143,6 +147,10 @@ def initialize(value)
143147
end
144148

145149
with '#last' do
150+
it "returns nil for an empty list" do
151+
expect(list.last).to be_nil
152+
end
153+
146154
it "can return the last item" do
147155
item = Item.new(1)
148156

0 commit comments

Comments
 (0)