1
0
mirror of https://github.com/danog/gift.git synced 2024-11-30 04:19:37 +01:00

Fix default identity of repo tests

This commit is contained in:
feugy 2014-02-12 18:39:19 +01:00
parent e340da9bbd
commit aba4c6ce6e
2 changed files with 16 additions and 12 deletions

2
test/mocha.opts Normal file
View File

@ -0,0 +1,2 @@
-R spec
--compilers coffee:coffee-script

View File

@ -143,22 +143,24 @@ describe "Repo", ->
# given a fresh new repo
before (done) ->
rimraf git_dir, (err) ->
return done err if err
return done err if err?
fs.mkdir git_dir, '0755', (err) ->
return done err if err
return done err if err?
git.init git_dir, (err) ->
return done err if err
return done err if err?
repo = git(git_dir)
fs.writeFileSync "#{git_dir}/foo.txt", "cheese"
repo.add "#{git_dir}/foo.txt", (err) ->
return done err if err
repo.commit 'message with spaces',
author: 'Someone <someone@somewhere.com>'
, (err) ->
return done err if err
repo.commits (err, _commits) ->
commit = _commits[0]
done err
repo.identify new Actor('root', 'root@domain.net'), (err) ->
return done err if err?
repo.add "#{git_dir}/foo.txt", (err) ->
return done err if err?
repo.commit 'message with spaces',
author: 'Someone <someone@somewhere.com>'
, (err) ->
return done err if err?
repo.commits (err, _commits) ->
commit = _commits[0]
done err
after (done) ->
rimraf git_dir, done