You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_collection.rb
    path of file: ./repos/arvados/sdk/ruby/test
    
    the code of the file until where you have to start completion: # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX
    
  def test_copy_stream_over_nonempty_stream_merges_and_overwrites
    blocks = random_blocks(3, 9)
    manifest_a =
      ["./subdir #{blocks[0]} 0:1:s1 1:2:zero\n",
       "./zdir #{blocks[1]} 0:9:zfile\n",
       "./zdir/subdir #{blocks[2]} 0:1:s2 1:2:zero\n"]
    coll = Arv::Collection.new(manifest_a.join(""))
    coll.cp_r("./subdir", "./zdir")
    manifest_a[2] = "./zdir/subdir %s %s 0:1:s1 9:1:s2 1:2:zero\n" %
      [blocks[0], blocks[2]]
    assert_equal(manifest_a.join(""), coll.manifest_text)
  end