Initialize Steps with a NewSTEPNAME function [#67]

This seems to be be a more natural separation of concerns--the knowledge
of which config fields map to which parts of a Step belong to the Step,
not to the Plan.
This commit is contained in:
Erin Call
2020-01-16 13:50:04 -08:00
parent 16117eea2f
commit 588c7cb9f7
16 changed files with 218 additions and 179 deletions

View File

@@ -3,6 +3,7 @@ package run
import (
"fmt"
"github.com/golang/mock/gomock"
"github.com/pelotech/drone-helm3/internal/env"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/suite"
"strings"
@@ -17,6 +18,15 @@ func TestHelpTestSuite(t *testing.T) {
suite.Run(t, new(HelpTestSuite))
}
func (suite *HelpTestSuite) TestNewHelp() {
cfg := env.Config{
Command: "everybody dance NOW!!",
}
help := NewHelp(cfg)
suite.Require().NotNil(help)
suite.Equal("everybody dance NOW!!", help.HelmCommand)
}
func (suite *HelpTestSuite) TestPrepare() {
ctrl := gomock.NewController(suite.T())
defer ctrl.Finish()