(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestImport(t *testing.T) { |
| 11 | is := is.New(t) |
| 12 | |
| 13 | cfg := &storageMock{ |
| 14 | SaveFunc: func(filename string) error { |
| 15 | return nil |
| 16 | }, |
| 17 | StoreFunc: func(profile string, key string, value string) {}, |
| 18 | } |
| 19 | |
| 20 | var b bytes.Buffer |
| 21 | |
| 22 | cmd := Import(cfg) |
| 23 | |
| 24 | cmd.SetOut(&b) |
| 25 | cmd.SetArgs([]string{"profile", `[{"key":"user.email","value":"work@example.com"}]`}) |
| 26 | err := cmd.Execute() |
| 27 | |
| 28 | is.NoErr(err) |
| 29 | is.Equal(trim(b.String()), "Successfully imported `profile` profile.") |
| 30 | } |