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_eval.rb
    path of file: ./repos/artichoke/artichoke-backend/vendor/ruby/test/ruby
    
    the code of the file until where you have to start completion: # frozen_string_literal: false
require 'test/unit'

class TestEval < T
    
  def test_instance_exec_eval_method_definition
    klass = Class.new
    o = klass.new

    o.instance_exec do
      eval %{
        def foo
          :foo_result
        end
      }
    end

    assert_respond_to o, :foo
    refute_respond_to klass, :foo
    refute_respond_to klass.new, :foo

    assert_equal :foo_result, o.foo
  end