]> source.dussan.org Git - jgit.git/commitdiff
In org.eclipse.jgit.pgm.ConfigTest expect core.filemode=false on Windows 05/6105/3
authorTomasz Zarna <Tomasz.Zarna@pl.ibm.com>
Fri, 15 Jun 2012 22:26:31 +0000 (00:26 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Fri, 15 Jun 2012 22:26:31 +0000 (00:26 +0200)
Change-Id: I8f8ae7a8bc0793643184bc0e7afa9f4e2c5ff1a1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.pgm.test/tst/org/eclipse/jgit/pgm/ConfigTest.java

index fe423da166873e9c898a84e6071eac64498d7e25..71e4c38698970fdf6284c4f746f8c364988ff267 100644 (file)
  */
 package org.eclipse.jgit.pgm;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertArrayEquals;
 
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.lib.CLIRepositoryTestCase;
+import org.eclipse.jgit.util.SystemReader;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -60,12 +60,14 @@ public class ConfigTest extends CLIRepositoryTestCase {
 
        @Test
        public void testListConfig() throws Exception {
+               boolean isWindows = SystemReader.getInstance().getProperty("os.name")
+                               .startsWith("Windows");
+
                String[] output = execute("git config --list");
-               // value depends on platform
-               assertTrue(output[0].startsWith("core.filemode="));
-               assertTrue(output[0].endsWith("true") || output[0].endsWith("false"));
-               assertEquals("core.logallrefupdates=true", output[1]);
-               assertEquals("core.repositoryformatversion=0", output[2]);
-               assertEquals("", output[3]); /* ends with LF (last line empty) */
+               assertArrayEquals("expected default configuration", //
+                               new String[] { "core.filemode=" + !isWindows, //
+                                               "core.logallrefupdates=true", //
+                                               "core.repositoryformatversion=0", //
+                                               "" /* ends with LF (last line empty) */}, output);
        }
 }