Rework specs around completing '~'.

This is because if there were no files in '~', the previous test would fail.
So instead, check for directories (which are more likely).

Also adds a test ensuring directory completion functions.