github.com/goonzoid/gcli@v0.2.3-0.20150926213610-155587606ea1/skeleton/framework_test.go (about)

     1  package skeleton
     2  
     3  import "testing"
     4  
     5  func TestFramework(t *testing.T) {
     6  	tests := []struct {
     7  		in      string
     8  		success bool
     9  		expt    string
    10  	}{
    11  		{"codegangsta", true, "codegangsta_cli"},
    12  		{"not_exist_cli", false, ""},
    13  	}
    14  
    15  	for i, tt := range tests {
    16  		out, err := FrameworkByName(tt.in)
    17  		if tt.success && err != nil {
    18  			t.Errorf("#%d expects error not to be occurred: %s", i, err)
    19  		}
    20  
    21  		if !tt.success {
    22  			continue
    23  		}
    24  
    25  		if out.Name != tt.expt {
    26  			t.Errorf("#%d expects %s to eq %s", i, out.Name, tt.expt)
    27  		}
    28  	}
    29  }