You didn't have to make a full-blown Faraday connection just to test the middleware. I realize that is how we wrote other middleware tests, but you can try making a more isolated test:

```rb
# makes an instance of middleware that simply returns the processed `env` object after it's called
def make_middleware(*args)
  app = lambda { |env| env[:request][:proxy] }
  Faraday::Request::Proxy.new(app, *args)
end

def make_env(url, request_options = {})
  uri = Faraday::Utils::URI(url)
  Faraday::Env.new(:get, nil, uri, request_options) 
end

def test_foo
  middleware = make_middleware(...)
  env = make_env("http://example.com")
  proxy = middleware.call(env)
  assert_equal "...", proxy.uri.to_s
end
```

Just an optional idea. I didn't test the above code