remove drone-hugo validate arg
The dependence of drone-hugo validate, hugo check, was removed since v0.92.0. As the hugo check does nothing in fact, a removal of command validate could be considered. - removed command validate in main.go and plugin_test.go - removed unused github.com/pkg/errors in plugin_test.go
This commit is contained in:
parent
3e380a7ddf
commit
5bb893c04e
2 changed files with 0 additions and 35 deletions
|
@ -2,28 +2,8 @@ package main
|
|||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func TestCommandValidate(t *testing.T) {
|
||||
config := Config{Validate: true}
|
||||
want := []string{"hugo", "check"}
|
||||
got := commandValidate(config)
|
||||
|
||||
if err := argsEqual(want, got.Args); err != nil {
|
||||
t.Errorf("%s", err)
|
||||
}
|
||||
|
||||
config = Config{Validate: true, Config: "config.toml"}
|
||||
want = []string{"hugo", "check", "--config", "config.toml"}
|
||||
got = commandValidate(config)
|
||||
|
||||
if err := argsEqual(want, got.Args); err != nil {
|
||||
t.Errorf("%s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestVersionEqual(t *testing.T) {
|
||||
want := true
|
||||
if got := versionsEqual("1.0", "1.0"); want != got {
|
||||
|
@ -35,12 +15,3 @@ func TestVersionEqual(t *testing.T) {
|
|||
t.Errorf("want: %t, got: %t", want, got)
|
||||
}
|
||||
}
|
||||
|
||||
func argsEqual(want []string, got []string) error {
|
||||
for i := range want {
|
||||
if want[i] != got[i] {
|
||||
return errors.Errorf("Arguments do not match, want: %s, got: %s", want[i], got[i])
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue