summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAdrien Hopkins <adrien.p.hopkins@gmail.com>2023-09-16 14:29:02 -0500
committerAdrien Hopkins <adrien.p.hopkins@gmail.com>2023-09-16 14:29:02 -0500
commit0b67f9500f8c9487b1e3c69209e44e00a0fdbd02 (patch)
tree235432aa55f977897f2cdd95295af7afa66420c4 /src/test
parent370fbe971379d4f833158d41f2c95cb669fb6dbf (diff)
Only create config directory when saving
Previously, if the user had no settings dir, starting the program would create it, but nothing would be read. If the user did not change their settings, it would just leave an empty directory!
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/sevenUnitsGUI/PresenterTest.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/java/sevenUnitsGUI/PresenterTest.java b/src/test/java/sevenUnitsGUI/PresenterTest.java
index 13d7986..5755701 100644
--- a/src/test/java/sevenUnitsGUI/PresenterTest.java
+++ b/src/test/java/sevenUnitsGUI/PresenterTest.java
@@ -18,6 +18,7 @@ package sevenUnitsGUI;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
import java.math.RoundingMode;
import java.nio.file.Path;
@@ -332,7 +333,8 @@ public final class PresenterTest {
presenter.setNumberDisplayRule(StandardDisplayRules.fixedPrecision(11));
presenter.setPrefixRepetitionRule(
DefaultPrefixRepetitionRule.COMPLEX_REPETITION);
- presenter.saveSettings(TEST_SETTINGS);
+ assumeTrue(presenter.writeSettings(TEST_SETTINGS),
+ "Could not write to settings file.");
// overwrite custom settings
presenter.setOneWayConversionEnabled(false);