Add tests for Local#test and Local#capture