mirror of
https://github.com/gofiber/storage.git
synced 2025-10-04 16:22:52 +08:00
chore: simplify testing panics
This commit is contained in:
@@ -231,11 +231,7 @@ func Test_MSSQL_Non_UTF8(t *testing.T) {
|
||||
}
|
||||
|
||||
func Test_SslRequiredMode(t *testing.T) {
|
||||
defer func() {
|
||||
if recover() == nil {
|
||||
require.Equalf(t, true, nil, "Connection was established with a `require`")
|
||||
}
|
||||
}()
|
||||
require.Panics(t, func() {
|
||||
_ = New(Config{
|
||||
Database: "fiber",
|
||||
Username: "username",
|
||||
@@ -243,6 +239,7 @@ func Test_SslRequiredMode(t *testing.T) {
|
||||
Reset: true,
|
||||
SslMode: "require",
|
||||
})
|
||||
}, "Expected panic when connecting to MSSQL with SSL mode set to require")
|
||||
}
|
||||
|
||||
func Test_MSSQL_Close(t *testing.T) {
|
||||
|
@@ -236,14 +236,11 @@ func Test_Postgres_Non_UTF8(t *testing.T) {
|
||||
}
|
||||
|
||||
func Test_SslRequiredMode(t *testing.T) {
|
||||
defer func() {
|
||||
if recover() == nil {
|
||||
require.Equalf(t, true, nil, "Connection was established with a `require`")
|
||||
}
|
||||
}()
|
||||
require.Panics(t, func() {
|
||||
_ = New(Config{
|
||||
Reset: true,
|
||||
})
|
||||
}, "Expected panic when connecting to Postgres with SSL mode set to require")
|
||||
}
|
||||
|
||||
func Test_Postgres_Conn(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user