diff --git a/spec/create.js b/spec/create.js index 7ab78472..7bdf4f91 100644 --- a/spec/create.js +++ b/spec/create.js @@ -10,10 +10,10 @@ prompt.get(['command', 'whatItDoes'], function(err, result) { var headless = new HeadlessGit(); headless.sendCommand(result.command); setTimeout(function() { - var testCase = '\texpectTreeAsync(' + - "\t\t'" + result.command + "'," + - "\t\t'" + headless.gitEngine.printTree() + "'" + - "\t);"; + var testCase = '\t\texpectTreeAsync(\n' + + "\t\t\t'" + result.command + "',\n" + + "\t\t\t'" + headless.gitEngine.printTree() + "'\n" + + "\t\t);\n"; console.log(testCase); // now add it @@ -23,8 +23,8 @@ prompt.get(['command', 'whatItDoes'], function(err, result) { var partOne = testFile.slice(0, toSlice); var partTwo = testFile.slice(toSlice); - var funcCall = "it('" + result.whatItDoes + "', function() {\n" + - testCase + "\n});"; + var funcCall = "\tit('" + result.whatItDoes + "', function() {\n" + + testCase + "\t});\n\n"; fs.writeFileSync('./remote.spec.js', partOne + funcCall + partTwo); }, 100); }); diff --git a/spec/remote.spec.js b/spec/remote.spec.js index 03f5ffc4..0736b0df 100644 --- a/spec/remote.spec.js +++ b/spec/remote.spec.js @@ -297,5 +297,12 @@ describe('Git Remotes', function() { ); }); + it('correctly resolves existing commits and upates', function() { + expectTreeAsync( + 'git clone; git push master:foo; git fakeTeamwork foo 2; git fetch origin foo^:blah;go C0; git fetch origin foo^:master', + '{"branches":{"master":{"target":"C2","id":"master","remoteTrackingBranchID":"o/master"},"o/master":{"target":"C1","id":"o/master","remoteTrackingBranchID":null},"o/foo":{"target":"C1","id":"o/foo","remoteTrackingBranchID":null},"blah":{"target":"C2","id":"blah","remoteTrackingBranchID":null}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"}},"HEAD":{"target":"C0","id":"HEAD"},"originTree":{"branches":{"master":{"target":"C1","id":"master","remoteTrackingBranchID":null},"foo":{"target":"C3","id":"foo","remoteTrackingBranchID":null}},"commits":{"C0":{"parents":[],"id":"C0","rootCommit":true},"C1":{"parents":["C0"],"id":"C1"},"C2":{"parents":["C1"],"id":"C2"},"C3":{"parents":["C2"],"id":"C3"}},"HEAD":{"target":"foo","id":"HEAD"}}}' + ); + }); + });