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_supervise.rb
    path of file: ./repos/polyphony/test
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require_relative 'helper'

class SuperviseTest < MiniTest::Test
  def test_supervise_with_block
    buffer = []
    f1 = spin(:f1) { receive }
    f2 = spin(:f2) { receive }
    supervisor = spin(:supervisor) { supervise(f1, f2) { |*args| buffer << args } }

    snooze
    f1 << 'foo'
    f1.await
    10.times { snooze }
    assert_equal [[f1, 'foo']], buffer

    f2 << 'bar'
    f2.await
    assert_equal [[f1, 'foo'], [f2, 'bar']], buffer
  end

  def test_supervise_with_on_done
    buffer = []
    f1 = spin(:f1) { receive }
    f2 = spi
    
  def test_supervise_with_manual_restart
    buffer = []
    f1 = spin(:f1) { receive }
    supervisor = spin(:supervisor) do
      supervise(f1) do |f, r|
        buffer << [f, r]
        f.restart
      end
    end

    snooze
    f1 << 'foo'
    f1.await
    snooze
    assert_equal [[f1, 'foo']], buffer

    10.times { snooze }

    assert_equal 1, supervisor.children.size
    f2 = supervisor.children.first
    assert f1 != f2
    assert_equal :f1, f2.tag
    assert_equal supervisor, f2.parent

    e = RuntimeError.new('bar')
    f2.raise(e)
    f2.await rescue nil
    3.times { snooze }
    assert_equal [[f1, 'foo'], [f2, e]], buffer

    assert_equal 1, supervisor.children.size
    f3 = supervisor.children.first
    assert f2 != f3
    assert f1 != f3
    assert_equal :f1, f3.tag
    assert_equal supervisor, f3.parent
  end