2013-12-06 14:23:02 +00:00
|
|
|
assert = require 'assert'
|
|
|
|
fs = require 'fs'
|
|
|
|
path = require 'path'
|
|
|
|
|
2013-12-15 16:31:40 +00:00
|
|
|
describe 'third-party module', ->
|
2013-12-06 14:23:02 +00:00
|
|
|
fixtures = path.join __dirname, 'fixtures'
|
|
|
|
|
2013-12-17 04:00:21 +00:00
|
|
|
describe 'runas', ->
|
2013-12-06 14:23:02 +00:00
|
|
|
it 'can be required in renderer', ->
|
2013-12-17 04:00:21 +00:00
|
|
|
require 'runas'
|
2013-12-06 14:23:02 +00:00
|
|
|
|
|
|
|
it 'can be required in node binary', (done) ->
|
2013-12-17 04:00:21 +00:00
|
|
|
runas = path.join fixtures, 'module', 'runas.js'
|
|
|
|
child = require('child_process').fork runas
|
2013-12-06 14:23:02 +00:00
|
|
|
child.on 'message', (msg) ->
|
|
|
|
assert.equal msg, 'ok'
|
|
|
|
done()
|