[git tests] setup username

Only in GitBranchWorkerTest for now.
This commit is contained in:
Kirill Likhodedov
2012-10-10 18:42:54 +04:00
parent ec6f3d2734
commit 1168b70686
2 changed files with 35 additions and 0 deletions
@@ -45,6 +45,7 @@ import static junit.framework.Assert.*
*/
@Mixin(GitExecutor)
@Mixin(GitScenarios)
@Mixin(GitLightTest)
class GitBranchWorkerTest {
private String myRootDir
@@ -103,6 +104,7 @@ class GitBranchWorkerTest {
private void initRepo(String repoRoot) {
cd repoRoot
git("init")
setupUsername();
touch("file.txt")
git("add file.txt")
git("commit -m initial")
@@ -0,0 +1,33 @@
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package git4idea.test
/**
*
* @author Kirill Likhodedov
*/
@Mixin(GitExecutor)
class GitLightTest {
public static final String USER_NAME = "John Doe";
public static final String USER_EMAIL = "John.Doe@example.com";
public void setupUsername() {
git("config user.name $USER_NAME")
git("config user.email $USER_EMAIL")
}
}