Assert that Lint.Prepare sets cmd.Stdout/Stderr [#3]
This commit is contained in:
parent
b93917c857
commit
30e1e3b99f
|
@ -34,9 +34,16 @@ func TestLintTestSuite(t *testing.T) {
|
|||
func (suite *LintTestSuite) TestPrepareAndExecute() {
|
||||
defer suite.ctrl.Finish()
|
||||
|
||||
stdout := strings.Builder{}
|
||||
stderr := strings.Builder{}
|
||||
|
||||
l := Lint{
|
||||
Chart: "./epic/mychart",
|
||||
}
|
||||
cfg := Config{
|
||||
Stdout: &stdout,
|
||||
Stderr: &stderr,
|
||||
}
|
||||
|
||||
command = func(path string, args ...string) cmd {
|
||||
suite.Equal(helmBin, path)
|
||||
|
@ -46,14 +53,13 @@ func (suite *LintTestSuite) TestPrepareAndExecute() {
|
|||
}
|
||||
|
||||
suite.mockCmd.EXPECT().
|
||||
Stdout(gomock.Any())
|
||||
Stdout(&stdout)
|
||||
suite.mockCmd.EXPECT().
|
||||
Stderr(gomock.Any())
|
||||
Stderr(&stderr)
|
||||
suite.mockCmd.EXPECT().
|
||||
Run().
|
||||
Times(1)
|
||||
|
||||
cfg := Config{}
|
||||
err := l.Prepare(cfg)
|
||||
suite.Require().Nil(err)
|
||||
l.Execute(cfg)
|
||||
|
|
Loading…
Reference in a new issue