Fixed tests when user is the root.

Mocked read permissions in the unit tests.
Merge pull request #884 from kyleknap/fix-test

Fixed tests when user is the root.