const {isRoot} = require('./is-root')

describe('is-root', () => {

  process.__getuid = process.getuid
  afterEach( () => process.getuid = process.__getuid)

  it('should return error if not in POSIX', () => {
    process.getuid = undefined
    expect(isRoot()).toEqual(Error('You are not in a POSIX system'))
  });

  it('should return true if root', () => {
    process.getuid = () => 0
    expect(isRoot()).toBe(true)
  });

  it('should return false if not root', () => {
    process.getuid = () => 1000
    expect(isRoot()).toBe(false)
  });

});


@@ -108,12 +108,11 @@
 fter
-Each
+All
 ( ()
@@ -148,16 +148,17 @@
 __getuid
+ 
 )%0A%0A  it(

reset process obj once only with afterAll