🐛 Remove first character of version string before parsing
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 27 Jun 2019 07:49:04 +0000 (09:49 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 27 Jun 2019 07:58:27 +0000 (09:58 +0200)
src/main/java/net/pterodactylus/sone/main/SonePlugin.java
src/test/kotlin/net/pterodactylus/sone/main/VersionParserTest.kt
src/test/resources/version.yaml

index 649ebf6..55f2590 100644 (file)
@@ -255,7 +255,7 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
                                bind(Context.class).toInstance(context);
                                bind(getOptionalContextTypeLiteral()).toInstance(of(context));
                                bind(SonePlugin.class).toInstance(SonePlugin.this);
-                               bind(Version.class).toInstance(Version.parse(getVersion()));
+                               bind(Version.class).toInstance(Version.parse(getVersion().substring(1)));
                                bind(PluginVersion.class).toInstance(new PluginVersion(getVersion()));
                                bind(PluginYear.class).toInstance(new PluginYear(getYear()));
                                bind(PluginHomepage.class).toInstance(new PluginHomepage(getHomepage()));
index f1702ce..fbf1584 100644 (file)
@@ -25,15 +25,15 @@ class VersionParserTest {
        @Test
        fun `default version file is parsed`() {
                val version = parseVersion()!!
-               assertThat(version.id, equalTo("43f3e1c3a0f487e37e5851a2cc72756d271c7571"))
-               assertThat(version.nice, equalTo("0.9.6-466-g43f3e1c"))
+               assertThat(version.id, equalTo("73241df664f676482d8ca2c13b03d3deac3eacba"))
+               assertThat(version.nice, equalTo("v79-2-g73241df6"))
        }
 
        @Test
        fun `parsed version is created correctly`() {
                val version = parsedVersion!!
-               assertThat(version.id, equalTo("43f3e1c3a0f487e37e5851a2cc72756d271c7571"))
-               assertThat(version.nice, equalTo("0.9.6-466-g43f3e1c"))
+               assertThat(version.id, equalTo("73241df664f676482d8ca2c13b03d3deac3eacba"))
+               assertThat(version.nice, equalTo("v79-2-g73241df6"))
        }
 
 }
index 22023b5..1b8dec2 100644 (file)
@@ -1,2 +1,2 @@
-id: 43f3e1c3a0f487e37e5851a2cc72756d271c7571
-nice: 0.9.6-466-g43f3e1c
+id: 73241df664f676482d8ca2c13b03d3deac3eacba
+nice: v79-2-g73241df6