mirror of
https://github.com/TECHNOFAB11/dbmate.git
synced 2025-12-12 08:00:04 +01:00
Initial commit
This commit is contained in:
commit
9cfc758ca1
14 changed files with 697 additions and 0 deletions
19
commands_test.go
Normal file
19
commands_test.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package main_test
|
||||
|
||||
import (
|
||||
"github.com/adrianmacneil/dbmate"
|
||||
"github.com/stretchr/testify/require"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGetDatabaseUrl(t *testing.T) {
|
||||
os.Setenv("DATABASE_URL", "postgres://example.org/db")
|
||||
|
||||
u, err := main.GetDatabaseURL()
|
||||
require.Nil(t, err)
|
||||
|
||||
require.Equal(t, "postgres", u.Scheme)
|
||||
require.Equal(t, "example.org", u.Host)
|
||||
require.Equal(t, "/db", u.Path)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue