Did you try turning it off and on yet?

A quick story today on an issue myself and a colleague ran into while writing some systems tests. If you are using the Fakeweb gem in Rails, you need to allow localhost to access the internet to run systems test like below.

After I pushed this fix to the repository, my colleague pulled the update but was still getting this error

After a little bit of detective work, what ended up working was setting

FakeWeb.allow_net_connect = true

, running a test and then reverting it back to to localhost. Basically turning it off and on. A weird interaction confirmed by me later that day when starting a new branch and trying to run systems test. Same issue.

Not sure what it is, but it is a weird bug that cost my colleague enough time to be written about. Let me know if you have run into this one or know what happened here.

Lesson of the day from our IT friends:

Did you try turning it off and on yet?