]> jaekl.net Git - cfb.git/commitdiff
Another unit test.
authorChris Jaekl <cejaekl@yahoo.com>
Sat, 9 Jan 2016 09:27:53 +0000 (18:27 +0900)
committerChris Jaekl <cejaekl@yahoo.com>
Sat, 9 Jan 2016 09:27:53 +0000 (18:27 +0900)
test/net/jaekl/cfb/util/EnvTest.java [new file with mode: 0644]

diff --git a/test/net/jaekl/cfb/util/EnvTest.java b/test/net/jaekl/cfb/util/EnvTest.java
new file mode 100644 (file)
index 0000000..254712d
--- /dev/null
@@ -0,0 +1,27 @@
+package net.jaekl.cfb.util;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class EnvTest {
+
+       @Test
+       public void test() {
+               String[] names = {
+                               "HOME",
+                               "THIS_ENVIRONMENT_VARIABLE_IS_NOT_SET",
+                               "TEMP",
+                               "TMP",
+                               "USER"
+                       };
+
+               EnvMock.mock_resetInstance();
+               
+               for (String name : names) {
+                       String expected = System.getenv(name);
+                       String actual = Env.get(name);
+                       assertEquals(expected, actual);
+               }
+       }
+}