working dir implementation and tests