Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
watermint committed Aug 28, 2020
1 parent a34ac0f commit 225809a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions recipe/dev/build/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/watermint/toolbox/quality/infra/qt_file"
"io/ioutil"
"os"
"path/filepath"
)

type License struct {
Expand Down Expand Up @@ -57,5 +58,6 @@ func (z *License) Test(c app_control.Control) error {
return rc_exec.Exec(c, &License{}, func(r rc_recipe.Recipe) {
m := r.(*License)
m.SourcePath = mo_path.NewExistingFileSystemPath(path)
m.DestPath = mo_path.NewFileSystemPath(filepath.Join(path, "licenses.json"))
})
}
16 changes: 15 additions & 1 deletion recipe/dev/build/readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import (
"github.com/watermint/toolbox/infra/doc/dc_section"
"github.com/watermint/toolbox/infra/recipe/rc_exec"
"github.com/watermint/toolbox/infra/recipe/rc_recipe"
"github.com/watermint/toolbox/quality/infra/qt_file"
"io/ioutil"
"os"
"path/filepath"
)

type Readme struct {
Expand Down Expand Up @@ -41,5 +44,16 @@ func (z *Readme) Exec(c app_control.Control) error {
}

func (z *Readme) Test(c app_control.Control) error {
return rc_exec.Exec(c, &Readme{}, rc_recipe.NoCustomValues)
path, err := qt_file.MakeTestFolder("readme", false)
if err != nil {
return err
}
defer func() {
_ = os.RemoveAll(path)
}()

return rc_exec.Exec(c, &Readme{}, func(r rc_recipe.Recipe) {
m := r.(*Readme)
m.Path = mo_path.NewFileSystemPath(filepath.Join(path, "README.txt"))
})
}

0 comments on commit 225809a

Please sign in to comment.