From 5de4e94a6fff34c200fa276e11277eb321b32993 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Sun, 19 Jun 2022 00:42:44 -0400 Subject: [PATCH] Added test for the config file. --- src/settings.rs | 1 + tests/features/server_start.feature | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/settings.rs b/src/settings.rs index 014d18e..e626b3c 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -13,6 +13,7 @@ impl Settings { let s = Config::builder() .set_default("port", 9090)? .set_default("address", "127.0.0.1")? + .add_source(config::File::with_name("morethantext").required(false)) .add_source( config::Environment::with_prefix("MTT") .try_parsing(true) diff --git a/tests/features/server_start.feature b/tests/features/server_start.feature index ab96997..ac33727 100644 --- a/tests/features/server_start.feature +++ b/tests/features/server_start.feature @@ -8,7 +8,14 @@ Feature: Server Start When the home page is accessed Then the status should be OK - Scenario: Start using the server on another port + Scenario: Start using the server on another port + Given a server + And port is changed to something different + And it is running + When the home page is accessed + Then the status should be OK + + Scenario: Using environment variables use another port Given a server And port is changed to something different And environment variables are used