Skip to content

Commit 0427975

Browse files
ctruedenclaude
andcommitted
Add unit test for URL environment config support
Co-authored-by: Claude <[email protected]>
1 parent 6427a1a commit 0427975

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/java/org/apposed/appose/builder/PixiBuilderTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
import java.io.File;
3939
import java.io.IOException;
40+
import java.net.URL;
4041

4142
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
4243
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -191,4 +192,21 @@ public void testContentPixiToml() throws Exception {
191192
assertInstanceOf(PixiBuilder.class, env.builder());
192193
cowsayAndAssert(env, "toml!");
193194
}
195+
196+
/** Tests building from a file:// URL to exercise URL support. */
197+
@Test
198+
public void testURLSupport() throws Exception {
199+
// Get absolute path and convert to file:// URL
200+
File configFile = new File("src/test/resources/envs/cowsay.yml").getAbsoluteFile();
201+
URL fileURL = configFile.toURI().toURL();
202+
203+
Environment env = Appose
204+
.pixi(fileURL)
205+
.base("target/envs/pixi-url-test")
206+
.logDebug()
207+
.build();
208+
209+
assertInstanceOf(PixiBuilder.class, env.builder());
210+
cowsayAndAssert(env, "url!");
211+
}
194212
}

0 commit comments

Comments
 (0)