Use stub_const over directly setting ENV in tests

Setting the environment can affect later tests, better to
use stub_const as per:

http://stackoverflow.com/a/19951660/183535