2023-04-26 14:54:36 +00:00
|
|
|
package config_tests
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2023-07-30 12:44:33 +00:00
|
|
|
func TestAutoLoad(t *testing.T) {
|
2023-04-26 14:54:36 +00:00
|
|
|
b := load(t, "./autoload_git")
|
2023-07-30 12:44:33 +00:00
|
|
|
assert.True(t, b.Config.Bundle.Git.Inferred)
|
|
|
|
assert.Contains(t, b.Config.Bundle.Git.OriginURL, "/cli")
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestManuallySetBranch(t *testing.T) {
|
|
|
|
b := loadEnvironment(t, "./autoload_git", "production")
|
|
|
|
assert.False(t, b.Config.Bundle.Git.Inferred)
|
|
|
|
assert.Equal(t, "main", b.Config.Bundle.Git.Branch)
|
|
|
|
assert.Contains(t, b.Config.Bundle.Git.OriginURL, "/cli")
|
2023-04-26 14:54:36 +00:00
|
|
|
}
|