Add test for enclosing environment