github.com/motyar/up@v0.2.10/config/static_test.go (about)

     1  package config
     2  
     3  import (
     4  	"os"
     5  	"testing"
     6  
     7  	"github.com/tj/assert"
     8  )
     9  
    10  func TestStatic(t *testing.T) {
    11  	cwd, _ := os.Getwd()
    12  
    13  	table := []struct {
    14  		Static
    15  		valid bool
    16  	}{
    17  		{Static{Dir: cwd}, true},
    18  		{Static{Dir: cwd + "/static_test.go"}, false},
    19  	}
    20  
    21  	for _, row := range table {
    22  		if row.valid {
    23  			assert.NoError(t, row.Validate())
    24  		} else {
    25  			assert.Error(t, row.Validate())
    26  		}
    27  	}
    28  }