woodpecker-helm3/internal/helm/config_test.go

29 lines
633 B
Go
Raw Normal View History

2019-12-09 17:56:02 +00:00
package helm
import (
"github.com/stretchr/testify/suite"
"testing"
)
type ConfigTestSuite struct {
suite.Suite
}
func TestConfigTestSuite(t *testing.T) {
suite.Run(t, new(ConfigTestSuite))
}
func (suite *ConfigTestSuite) TestHelmCommandDecodeSuccess() {
cmd := helmCommand("")
2019-12-09 17:56:02 +00:00
err := cmd.Decode("upgrade")
suite.Require().Nil(err)
suite.EqualValues(cmd, "upgrade")
}
func (suite *ConfigTestSuite) TestHelmCommandDecodeFailure() {
cmd := helmCommand("")
2019-12-09 17:56:02 +00:00
err := cmd.Decode("execute order 66")
suite.EqualError(err, "unknown command 'execute order 66'. If specified, command must be upgrade, delete, lint, or help")
2019-12-09 17:56:02 +00:00
}