[COOK-2869] better test for empty directory

https://tickets.opscode.com/browse/COOK-2869