mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 19:04:02 +03:00
FILE / ScuroNeko/mtg
internal/cli/base_internal_test.go
Исходный файл и его история в репозитории.
34 lines
593 B
Go
34 lines
593 B
Go
package cli
|
|
|
|
import (
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/suite"
|
|
)
|
|
|
|
type BaseTestSuite struct {
|
|
suite.Suite
|
|
|
|
b base
|
|
}
|
|
|
|
func (suite *BaseTestSuite) SetupTest() {
|
|
suite.b = base{}
|
|
}
|
|
|
|
func (suite *BaseTestSuite) TestReadConfigNok() {
|
|
suite.b.ConfigPath = filepath.Join("testdata", "unknown")
|
|
suite.Error(suite.b.ReadConfig("dev"))
|
|
}
|
|
|
|
func (suite *BaseTestSuite) TestReadConfig() {
|
|
suite.b.ConfigPath = filepath.Join("testdata", "minimal.toml")
|
|
suite.NoError(suite.b.ReadConfig("dev"))
|
|
}
|
|
|
|
func TestBase(t *testing.T) {
|
|
t.Parallel()
|
|
suite.Run(t, &BaseTestSuite{})
|
|
}
|