Closed tredman closed 5 years ago
There doesn't seem to be an easy way to test that a request went through a proxy with webmock. I tested this locally with mitmproxy and a simple script:
libhoney = Libhoney::Client.new(:writekey => "YOUR_API_KEY",
:dataset => "honeycomb-ruby-example",
:api_host => 'http://api.honeycomb.io',
:proxy_config => ['localhost', 8080])
ev = libhoney.event
ev.add({
"duration_ms": 153.12,
"method": "get",
"hostname": "appserver15",
"payload_length": 27
})
ev.send
Then verified this going through my local mitmproxy, so the proxy code works.
I tested this locally with mitmproxy to verify that requests were being proxied. I can't seem to use mocks to verify the proxying though, so I'm at a loss for how to write tests for this right now.