I’ll admit that it took me a little while to figure this one out, but I eventually got it.

def test_slicing_arrays
  array = [:peanut, :butter, :and, :jelly]

  assert_equal [:peanut], array[0,1]
  assert_equal [:peanut, :butter], array[0,2]
  assert_equal [:and, :jelly], array[2,2]
  assert_equal [:and, :jelly], array[2,20]
  assert_equal [], array[4,0]
  assert_equal [], array[4,100]
  assert_equal nil, array[5,0]
end

The first 6 assertions were no big deal, but that last one confused me. Then I figured out that you can always append to an array by accessing the next element. If your array has 4 elements, then you can access indices 0 through 4, where 0 through 3 are already assigned, and the 4th index is the unassigned 5th element. So, array[4,1] is an empty array slice, but array[5, 1] is nil.