1
0
mirror of https://github.com/danog/gift.git synced 2024-11-30 04:19:37 +01:00
gift/test/index.test.coffee
Sergey Kovalyov a197fe7ba0 Git.clone() added
* Wrapper for `git clone` command.
* Test added and custom 30000 timeout is set to it as cloning requires
quite some time.
* Documentation updated.
2013-09-23 18:19:19 +02:00

27 lines
777 B
CoffeeScript

should = require 'should'
git = require '../src'
Repo = require '../src/repo'
{exec} = require 'child_process'
describe "git", ->
describe "()", ->
repo = git "#{__dirname}/fixtures/simple"
it "returns a Repo", ->
repo.should.be.an.instanceof Repo
describe "clone()", ->
@timeout 30000
repo = null
newRepositoryDir = "#{__dirname}/fixtures/clone"
before (done) ->
git.clone "git@github.com:sentientwaffle/gift.git", newRepositoryDir, (err, _repo) ->
repo = _repo
done err
it "clone a repository", (done) ->
repo.should.be.an.instanceof Repo
repo.remote_list (err, remotes) ->
remotes.should.have.length 1
done()
after (done) ->
exec "rm -rf #{newRepositoryDir}", done