github.com/jlmeeker/kismatic@v1.10.1-0.20180612190640-57f9005a1f1a/pkg/inspector/rule/executable_test.go (about)

     1  package rule
     2  
     3  import "testing"
     4  
     5  func TestExecutableInPathRuleValidation(t *testing.T) {
     6  	e := ExecutableInPath{}
     7  	if errs := e.Validate(); len(errs) != 1 {
     8  		t.Errorf("expected 1 error, but got %d", len(errs))
     9  	}
    10  	e.Executable = "123"
    11  	if errs := e.Validate(); len(errs) != 1 {
    12  		t.Errorf("expected 1 error, but got %d", len(errs))
    13  	}
    14  	e.Executable = "foo"
    15  	if errs := e.Validate(); len(errs) != 0 {
    16  		t.Errorf("Expected 0 errors, but got %d", len(errs))
    17  	}
    18  }