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() {
|
func (suite *LintTestSuite) TestPrepareAndExecute() {
|
||||||
defer suite.ctrl.Finish()
|
defer suite.ctrl.Finish()
|
||||||
|
|
||||||
|
stdout := strings.Builder{}
|
||||||
|
stderr := strings.Builder{}
|
||||||
|
|
||||||
l := Lint{
|
l := Lint{
|
||||||
Chart: "./epic/mychart",
|
Chart: "./epic/mychart",
|
||||||
}
|
}
|
||||||
|
cfg := Config{
|
||||||
|
Stdout: &stdout,
|
||||||
|
Stderr: &stderr,
|
||||||
|
}
|
||||||
|
|
||||||
command = func(path string, args ...string) cmd {
|
command = func(path string, args ...string) cmd {
|
||||||
suite.Equal(helmBin, path)
|
suite.Equal(helmBin, path)
|
||||||
|
@ -46,14 +53,13 @@ func (suite *LintTestSuite) TestPrepareAndExecute() {
|
||||||
}
|
}
|
||||||
|
|
||||||
suite.mockCmd.EXPECT().
|
suite.mockCmd.EXPECT().
|
||||||
Stdout(gomock.Any())
|
Stdout(&stdout)
|
||||||
suite.mockCmd.EXPECT().
|
suite.mockCmd.EXPECT().
|
||||||
Stderr(gomock.Any())
|
Stderr(&stderr)
|
||||||
suite.mockCmd.EXPECT().
|
suite.mockCmd.EXPECT().
|
||||||
Run().
|
Run().
|
||||||
Times(1)
|
Times(1)
|
||||||
|
|
||||||
cfg := Config{}
|
|
||||||
err := l.Prepare(cfg)
|
err := l.Prepare(cfg)
|
||||||
suite.Require().Nil(err)
|
suite.Require().Nil(err)
|
||||||
l.Execute(cfg)
|
l.Execute(cfg)
|
||||||
|
|
Loading…
Reference in a new issue