Skip to content

Commit

Permalink
Add coverage for empty lists.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jul 11, 2024
1 parent a5779eb commit 5a4d8d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/async/list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ def initialize(value)
end

with '#first' do
it "returns nil for an empty list" do
expect(list.first).to be_nil
end

it "can return the first item" do
item = Item.new(1)

Expand All @@ -143,6 +147,10 @@ def initialize(value)
end

with '#last' do
it "returns nil for an empty list" do
expect(list.last).to be_nil
end

it "can return the last item" do
item = Item.new(1)

Expand Down

0 comments on commit 5a4d8d6

Please sign in to comment.