Skip to content

Commit

Permalink
FORGE-320: added test case for createBranch method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jevgeni Zelenkov committed Jul 17, 2012
1 parent fa0bcc7 commit 7479b96
Showing 1 changed file with 21 additions and 0 deletions.
Expand Up @@ -334,4 +334,25 @@ public void shouldDiscardLastCommit() throws Exception
Assert.assertFalse("file should not exist", project.getProjectRoot().getChild(files[1]).exists());
}

@Test
public void shouldCreateNewBranch() throws Exception
{
// git init
// create new branch
// verify branch exists

String testBranchName = "testBranch";
Project project = initializeJavaProject();
Git repo = GitUtils.init(project.getProjectRoot());

GitUtils.addAll(repo);
GitUtils.commitAll(repo, "initial commit");

Ref testBranch = GitUtils.createBranch(repo, testBranchName);
Assert.assertNotNull(testBranch);

List<Ref> branches = GitUtils.getLocalBranches(repo);
Assert.assertTrue("Branch is not created", branches.contains(testBranch));
}

}

0 comments on commit 7479b96

Please sign in to comment.