git ssb

0+

cel / pull-git-remote-helper



Tree: 89810d797532892ef70d5ee23f3b82c5466e7858

Files: 89810d797532892ef70d5ee23f3b82c5466e7858 / test / run.js

831 bytesRaw
1var spawn = require('child_process').spawn
2var tape = require('tape')
3var path = require('path')
4var mktemp = require('mktemp')
5var rimraf = require('rimraf')
6
7var env = Object.create(process.env)
8env.PATH = __dirname + ':' + env.PATH
9var remote = 'test.js://foo'
10
11var tmpDir = mktemp.createDirSync(path.join(require('os').tmpdir(), 'XXXXXXX'))
12
13function git(args, cb) {
14 spawn('git', args, {
15 env: env,
16 cwd: tmpDir,
17 stdio: ['ignore', process.stderr, process.stderr]
18 }).on('close', cb)
19}
20
21tape('init repo', function (t) {
22 git(['init'], function (code) {
23 t.equals(code, 0, 'inited')
24 t.end()
25 })
26})
27
28tape('push with empty repo', function (t) {
29 git(['push', remote], function (code) {
30 t.equals(code, 0, 'pushed')
31 t.end()
32 })
33})
34
35tape.onFinish(function () {
36 if (tmpDir)
37 rimraf.sync(tmpDir)
38})
39

Built with git-ssb-web