UNPKG

1.7 kBtext/coffeescriptView Raw
1
2dojo = require '..'
3fs = require 'fs'
4each = require 'each'
5should = require 'should'
6
7describe 'Git', ->
8 it 'should download dojo HEAD', (next) ->
9 @timeout 0
10 middleware = dojo method: 'git'
11 req = url: 'http://localhost'
12 res = {}
13 middleware req, res, (err) ->
14 should.not.exist err
15 each([
16 '/tmp/git-dojo-HEAD'
17 '/tmp/git-dijit-HEAD'
18 '/tmp/git-dojox-HEAD'
19 '/tmp/git-util-HEAD'
20 ])
21 .on 'item', (next, path) ->
22 fs.stat path, (err, stats) ->
23 should.not.exist err
24 stats.isDirectory().should.be.ok
25 next()
26 .on 'both', next
27 it 'should download specified revisions', (next) ->
28 @timeout 0
29 middleware = dojo
30 method: 'git',
31 dojo_revision: '852b5161559f3eda16dc'
32 dijit_revision: '37b5298bb8b4f24134d5'
33 dojox_revision: '145d3bec095382c2f4ac'
34 util_revision: 'f9cbb550e2959024df57'
35 req = { url: 'http://localhost' }
36 res = {}
37 middleware req, res, (err) ->
38 should.not.exist err
39 each([
40 '/tmp/git-dojo-852b5161559f3eda16dc'
41 '/tmp/git-dijit-37b5298bb8b4f24134d5'
42 '/tmp/git-dojox-145d3bec095382c2f4ac'
43 '/tmp/git-util-f9cbb550e2959024df57'
44 ])
45 .on 'item', (next, path) ->
46 fs.stat path, (err, stats) ->
47 should.not.exist err
48 stats.isDirectory().should.be.ok
49 next()
50 .on 'both', next