add tests for running commands from a subdirectory

see #362