From aba4c6ce6ea9a12a50f99ca876ea1d0a29ed8991 Mon Sep 17 00:00:00 2001 From: feugy Date: Wed, 12 Feb 2014 18:39:19 +0100 Subject: [PATCH] Fix default identity of repo tests --- test/mocha.opts | 2 ++ test/repo.test.coffee | 26 ++++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 test/mocha.opts diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 0000000..0ee5433 --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1,2 @@ +-R spec +--compilers coffee:coffee-script \ No newline at end of file diff --git a/test/repo.test.coffee b/test/repo.test.coffee index 1dcd75b..656b263 100644 --- a/test/repo.test.coffee +++ b/test/repo.test.coffee @@ -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 ' - , (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 ' + , (err) -> + return done err if err? + repo.commits (err, _commits) -> + commit = _commits[0] + done err after (done) -> rimraf git_dir, done