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: exec_spec.rb
    path of file: ./repos/test-kitchen/spec/kitchen/transport
    
    the code of the file until where you have to start completion: #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

require_relative "../../spec_helper"

require "kitchen/transp
    
    def self.common_connection_specs
      before do
        config[:kitchen_root] = "/i/am/root"
      end

      it "returns a Kitchen::Transport::Exec::Connection object" do
        _(transport.connection(state)).must_be_kind_of klass
      end

      it "sets :instance_name to the instance's name" do
        klass.expects(:new).with do |hash|
          hash[:instance_name] == "coolbeans"
        end

        make_connection
      end

      it "sets :kitchen_root to the transport's kitchen_root" do
        klass.expects(:new).with do |hash|
          hash[:kitchen_root] == "/i/am/root"
        end

        make_connection
      end

      describe "called without a block" do
        def make_connection(s = state) # rubocop:disable Lint/NestedMethodDefinition
          transport.connection(s)
        end

        common_connection_specs
      end

      describe "called with a block" do
        def make_connection(s = state) # rubocop:disable Lint/NestedMethodDefinition
          transport.connection(s) do |conn|
            conn
          end
        end

        common_connection_specs
      end
    end