Fix some tests in ConfigTest
Some of the ConfigTest tests created a FileRepositoryBuilder but didn't use it to actually create a FileRepository. Change-Id: I1a4b27891daee1b235a71e7bbf2a7588b9d11a53
This commit is contained in:
parent
a2f326b762
commit
e29834a77d
|
@ -1482,7 +1482,9 @@ public void testCommitTemplateConfig()
|
||||||
|
|
||||||
File workTree = tmp.newFolder("dummy-worktree");
|
File workTree = tmp.newFolder("dummy-worktree");
|
||||||
File tempFile = tmp.newFile("testCommitTemplate-");
|
File tempFile = tmp.newFile("testCommitTemplate-");
|
||||||
Repository repo = FileRepositoryBuilder.create(workTree);
|
Repository repo = FileRepositoryBuilder
|
||||||
|
.create(new File(workTree, ".git"));
|
||||||
|
repo.create();
|
||||||
String templateContent = "content of the template";
|
String templateContent = "content of the template";
|
||||||
JGitTestUtil.write(tempFile, templateContent);
|
JGitTestUtil.write(tempFile, templateContent);
|
||||||
String expectedTemplatePath = tempFile.getPath();
|
String expectedTemplatePath = tempFile.getPath();
|
||||||
|
@ -1532,7 +1534,9 @@ public void testCommitTemplateEncoding()
|
||||||
throws ConfigInvalidException, IOException {
|
throws ConfigInvalidException, IOException {
|
||||||
Config config = new Config(null);
|
Config config = new Config(null);
|
||||||
File workTree = tmp.newFolder("dummy-worktree");
|
File workTree = tmp.newFolder("dummy-worktree");
|
||||||
Repository repo = FileRepositoryBuilder.create(workTree);
|
Repository repo = FileRepositoryBuilder
|
||||||
|
.create(new File(workTree, ".git"));
|
||||||
|
repo.create();
|
||||||
File tempFile = tmp.newFile("testCommitTemplate-");
|
File tempFile = tmp.newFile("testCommitTemplate-");
|
||||||
String templateContent = "content of the template";
|
String templateContent = "content of the template";
|
||||||
JGitTestUtil.write(tempFile, templateContent);
|
JGitTestUtil.write(tempFile, templateContent);
|
||||||
|
@ -1554,7 +1558,9 @@ public void testCommitTemplateWithInvalidEncoding()
|
||||||
Config config = new Config(null);
|
Config config = new Config(null);
|
||||||
File workTree = tmp.newFolder("dummy-worktree");
|
File workTree = tmp.newFolder("dummy-worktree");
|
||||||
File tempFile = tmp.newFile("testCommitTemplate-");
|
File tempFile = tmp.newFile("testCommitTemplate-");
|
||||||
Repository repo = FileRepositoryBuilder.create(workTree);
|
Repository repo = FileRepositoryBuilder
|
||||||
|
.create(new File(workTree, ".git"));
|
||||||
|
repo.create();
|
||||||
String templateContent = "content of the template";
|
String templateContent = "content of the template";
|
||||||
JGitTestUtil.write(tempFile, templateContent);
|
JGitTestUtil.write(tempFile, templateContent);
|
||||||
config = parse("[i18n]\n\tcommitEncoding = invalidEcoding\n"
|
config = parse("[i18n]\n\tcommitEncoding = invalidEcoding\n"
|
||||||
|
@ -1569,7 +1575,9 @@ public void testCommitTemplateWithInvalidPath()
|
||||||
Config config = new Config(null);
|
Config config = new Config(null);
|
||||||
File workTree = tmp.newFolder("dummy-worktree");
|
File workTree = tmp.newFolder("dummy-worktree");
|
||||||
File tempFile = tmp.newFile("testCommitTemplate-");
|
File tempFile = tmp.newFile("testCommitTemplate-");
|
||||||
Repository repo = FileRepositoryBuilder.create(workTree);
|
Repository repo = FileRepositoryBuilder
|
||||||
|
.create(new File(workTree, ".git"));
|
||||||
|
repo.create();
|
||||||
String templateContent = "content of the template";
|
String templateContent = "content of the template";
|
||||||
JGitTestUtil.write(tempFile, templateContent);
|
JGitTestUtil.write(tempFile, templateContent);
|
||||||
// commit message encoding
|
// commit message encoding
|
||||||
|
|
Loading…
Reference in New Issue