(t *testing.T)
| 109 | } |
| 110 | |
| 111 | func TestC_Default(t *testing.T) { |
| 112 | c := New() |
| 113 | c.ProvideEssentials() |
| 114 | c.Provide(otgorm.Providers()) |
| 115 | c.AddModuleFunc(config.New) |
| 116 | |
| 117 | f, _ := ioutil.TempFile("./", "*") |
| 118 | defer func() { |
| 119 | f.Close() |
| 120 | os.Remove(f.Name()) |
| 121 | }() |
| 122 | |
| 123 | rootCommand := &cobra.Command{} |
| 124 | c.ApplyRootCommand(rootCommand) |
| 125 | rootCommand.SetArgs([]string{"config", "init", "-o", f.Name()}) |
| 126 | rootCommand.Execute() |
| 127 | |
| 128 | output, _ := ioutil.ReadFile(f.Name()) |
| 129 | assert.Contains(t, string(output), "gorm:") |
| 130 | } |
| 131 | |
| 132 | type m1 struct { |
| 133 | A int |
nothing calls this directly
no test coverage detected