HTTP Proxy support via ENV variables

My first bit of Ruby code ever!

I'm not sure how to write a test for this though.  In my testing I would set the ENV variable as the following and then puts connection_opts after each to ensure all looked good:
http//user:pass@servername:port
http//user:pass@servername
http//servername:port
http//servername
http//user:pass@ip:port
http//user:pass@ip
http//ip:port
http//ip

Any pointers to documents on how to repeat that with my chosen ENV values and check for my expected values?

Also when I set the ENV value all the tests failed as it pushed to a proxy that was trying to request localhost obviously looking for the fixtures server.  Do I need to create a proxy server in rack to make that happy? If so again do you have any pointers?

Sorry to be n00b like just looking to learn and contribute :)