func main() { flag.Parse() api, err := ramlapi.Process(ramlFile) if err != nil { log.Fatal(err) } log.Println("Processing API spec for", ramlFile) generate(api, genFile) log.Println("Created handlers in ", genFile) }
func TestGenerate(t *testing.T) { api, _ := ramlapi.Process("../fixtures/valid.raml") currentOutput := fmt.Sprintf(output, os.TempDir(), int32(time.Now().Unix())) generate(api, currentOutput) _, err := os.Open(currentOutput) if err != nil { t.Fatalf("Expected output file to exist, got %v\n", err) } os.Remove(currentOutput) }