1 |
|
2 | should = require 'should'
|
3 | mecano = if process.env.MECANO_COV then require '../lib-cov/mecano' else require '../lib/mecano'
|
4 | test = require './test'
|
5 |
|
6 | describe 'git', ->
|
7 |
|
8 | scratch = test.scratch @
|
9 |
|
10 | beforeEach (next) ->
|
11 | mecano.extract
|
12 | source: "#{__dirname}/../resources/repo.git.zip"
|
13 | destination: "#{scratch}"
|
14 | , next
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | it 'should clone repo into new dir', (next) ->
|
30 | mecano.git
|
31 | source: "#{scratch}/repo.git"
|
32 | destination: "#{scratch}/my_repo"
|
33 | , (err, updated) ->
|
34 | should.not.exist err
|
35 | updated.should.eql 1
|
36 | mecano.git
|
37 | source: "#{scratch}/repo.git"
|
38 | destination: "#{scratch}/my_repo"
|
39 | , (err, updated) ->
|
40 | updated.should.eql 0
|
41 | next()
|
42 |
|
43 | it 'should honore revision', (next) ->
|
44 | mecano.git
|
45 | source: "#{scratch}/repo.git"
|
46 | destination: "#{scratch}/my_repo"
|
47 | , (err, updated) ->
|
48 | should.not.exist err
|
49 | mecano.git
|
50 | source: "#{scratch}/repo.git"
|
51 | destination: "#{scratch}/my_repo"
|
52 | revision: 'v0.0.1'
|
53 | , (err, updated) ->
|
54 | updated.should.eql 1
|
55 | mecano.git
|
56 | source: "#{scratch}/repo.git"
|
57 | destination: "#{scratch}/my_repo"
|
58 | revision: 'v0.0.1'
|
59 | , (err, updated) ->
|
60 | updated.should.eql 0
|
61 | next()
|
62 |
|