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: proxy_tests.rb
    path of file: ./repos/excon/tests
    
    the code of the file until where you have to start completion: Shindo.tests('Excon proxy support') do
  env_init

  tests('proxy configuration') do

    tests('no proxy') do
      tests('connection.data[:proxy]').returns(nil) do
        connection = Excon.new('http://foo.com')
        connection.data[:proxy]
      end
    end

    tests('empty proxy') do
      tests('connection.data[:proxy]').returns(nil) do
        connection = Excon.new('http://foo.com', :proxy => '')
        connection.data[:proxy]
      end
    end

    tests('with fully-specified proxy: https://myproxy.net:8080') do
      connection = nil

      tests('connection.data[:proxy][:host]').returns('myproxy.net') do
        connection = Excon.new('http://foo.com', :proxy => 'https://myproxy.net:8080')
        connection.data[:proxy][:host]
      end

      tests('connection.data[:proxy][:port]').returns(8080) do
        connection.data[:proxy][:port]
      end

      tests('connection.data[:proxy][:scheme]').returns('https') do
        connection.data[:proxy][:scheme]
      end
    end

    tests('with fully-specified Unix socket proxy: unix:///') do
      connection = nil

      tests('connection.data[:proxy][:host]').returns(nil) do
        connection = Excon.new('http://foo.com', :proxy => 'unix:///tmp/myproxy.sock')
        connection.data[:proxy][:host]
      end

      tests('connection.data[:proxy][:port]').returns(nil) do
        connection.data[:proxy][:port]
      end

      tests('connection.data[:proxy][:scheme]').returns('unix') do
        connection.data[:proxy][:scheme]
      end

      tests('connection.data[:proxy][:path]').returns('/tmp/myproxy.sock') do
        connection.data[:proxy][:path]
      end
    end

    def env_proxy_tests(env)
      env_init(env)

      tests('an http connection') do
        connection = nil

        tests('connection.data[:proxy][:host]').returns('myproxy') do
          connection = Excon.new('http://foo.com')
          connection.data[:proxy][:host]
        end

        tests('connection.data[:proxy][:port]').returns(8080) do
          connection.data[:proxy][:port]
        end

        tests('connection.data[:proxy][:scheme]').returns('http') do
          connection.data[:proxy][:scheme]
        end

        tests('with disable_proxy set') do
          connection = nil

          tests('connection.data[:proxy]').returns(nil) do
            connection = Excon.new('http://foo.com', :disable_proxy => true)
            connection.data[:proxy]
          end
        end
      end

      tests('an https connection') do
        connection = nil

        tests('connection.data[:proxy][:host]').returns('mysecureproxy') do
          connection = Excon.new('https://secret.com')
          connection.data[
    
    def env_proxy_tests(env)
      env_init(env)

      tests('an http connection') do
        connection = nil

        tests('connection.data[:proxy][:host]').returns('myproxy') do
          connection = Excon.new('http://foo.com')
          connection.data[:proxy][:host]
        end

        tests('connection.data[:proxy][:port]').returns(8080) do
          connection.data[:proxy][:port]
        end

        tests('connection.data[:proxy][:scheme]').returns('http') do
          connection.data[:proxy][:scheme]
        end

        tests('with disable_proxy set') do
          connection = nil

          tests('connection.data[:proxy]').returns(nil) do
            connection = Excon.new('http://foo.com', :disable_proxy => true)
            connection.data[:proxy]
          end
        end
      end

      tests('an https connection') do
        connection = nil

        tests('connection.data[:proxy][:host]').returns('mysecureproxy') do
          connection = Excon.new('https://secret.com')
          connection.data[:proxy][:host]
        end

        tests('connection.data[:proxy][:port]').returns(8081) do
          connection.data[:proxy][:port]
        end

        tests('connection.data[:proxy][:scheme]').returns('http') do
          connection.data[:proxy][:scheme]
        end

        tests('with disable_proxy set') do
          connection = nil

          tests('connection.data[:proxy]').returns(nil) do
            connection = Excon.new('https://foo.com', :disable_proxy => true)
            connection.data[:proxy]
          end
        end
      end

      tests('http proxy from the environment overrides config') do
        connection = nil

        tests('connection.data[:proxy][:host]').returns('myproxy') do
          connection = Excon.new('http://foo.com', :proxy => 'http://hard.coded.proxy:6666')
          connection.data[:proxy][:host]
        end

        tests('connection.data[:proxy][:port]').returns(8080) do
          connection.data[:proxy][:port]
        end
      end

      tests('an http connection in no_proxy') do
        tests('connection.data[:proxy]').returns(nil) do
          connection = Excon.new('http://somesubdomain.noproxy')
          connection.data[:proxy]
        end
      end

      tests('an http connection not completely matching no_proxy') do
        tests('connection.data[:proxy][:host]').returns('myproxy') do
          connection = Excon.new('http://noproxy2')
          connection.data[:proxy][:host]
        end
      end

      tests('an http connection with subdomain in no_proxy') do
        tests('connection.data[:proxy]').returns(nil) do
          connection = Excon.new('http://a.subdomain.noproxy2')
          connection.data[:proxy]
        end
      end

      env_restore
    end