(PUP-3850) Stub methods when executing as root
Previously, the inspect_spec test would fail when running as root,
because it would try to set the file mode to 0, assuming puppet
wouldn't be able to read it. But of course, that doesn't stop root.
This commit skips the test when running as root.
When running the master_spec test as root, it would attempt to chuser
to the puppet user and group, and would fail if those accounts didn't
exist. This commit stubs the call to chuser to ensure we don't
actually try to switch user.
When running the file_spec test, it attempted to stub
Puppet.features.root? assuming SUIDManager.root? would call it. But
that was backwards, the feature calls the SUIDManager. This commit
moves the stub onto the method that is actually called.