From 006cf87b14ed6cb5433f530a3aea82ee6b7210a0 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 24 Dec 2024 14:39:08 +0300 Subject: [PATCH] more tests --- src/test/java/com/rultor/EnvTest.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/test/java/com/rultor/EnvTest.java b/src/test/java/com/rultor/EnvTest.java index 73b0f762af..cbf43db451 100644 --- a/src/test/java/com/rultor/EnvTest.java +++ b/src/test/java/com/rultor/EnvTest.java @@ -63,6 +63,16 @@ void readsFromManifest() { ); } + @Test + void readsVersionFromManifest() { + this.environment.remove(Env.SETTINGS_XML); + MatcherAssert.assertThat( + "takes the right value of the version", + Env.read("Rultor-Version"), + Matchers.not(Matchers.emptyString()) + ); + } + @Test void readsRevisionFromManifest() { this.environment.remove(Env.SETTINGS_XML); @@ -108,4 +118,17 @@ void readsRevisionFromSettingsXml() { Matchers.not(Matchers.emptyString()) ); } + + @Test + void readsVersionFromSettingsXml() { + this.environment.set( + Env.SETTINGS_XML, + "" + ); + MatcherAssert.assertThat( + "takes the right value of the version, while it's absent in the XML", + Env.read("Rultor-Version"), + Matchers.not(Matchers.emptyString()) + ); + } }