improved rails test environment support