Skip to content

Commit 5d99287

Browse files
committed
fixed tests
1 parent 925c07a commit 5d99287

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

config_test.go

+10
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ func TestEnvironmentSettingFormat(t *testing.T) {
101101
}
102102

103103
func TestConfig_Port(t *testing.T) {
104+
defer func() {
105+
if r := recover(); r == nil {
106+
t.Errorf("initConfig should panic on invalid port config")
107+
}
108+
}()
104109
port := config.PublishPort
105110
os.Setenv("PUBLISH_PORT", "noNumber")
106111
defer os.Unsetenv("PUBLISH_PORT")
@@ -121,6 +126,11 @@ func TestConfig_Addr(t *testing.T) {
121126
}
122127

123128
func TestConfig_Http_URL(t *testing.T) {
129+
defer func() {
130+
if r := recover(); r == nil {
131+
t.Errorf("initConfig should panic on invalid url config")
132+
}
133+
}()
124134
url := config.RabbitURL
125135
os.Setenv("RABBIT_URL", "ftp://test")
126136
defer os.Unsetenv("RABBIT_URL")

0 commit comments

Comments
 (0)