github.com/ryanbennettvoid/go-swagger@v0.18.1-0.20190104015444-3854bbbe2392/cmd/swagger/commands/expand_test.go (about) 1 package commands 2 3 import ( 4 "os" 5 "path/filepath" 6 "testing" 7 8 flags "github.com/jessevdk/go-flags" 9 ) 10 11 // Commands requires at least one arg 12 func TestCmd_Expand(t *testing.T) { 13 v := &ExpandSpec{} 14 testRequireParam(t, v) 15 } 16 17 func TestCmd_Expand_NoError(t *testing.T) { 18 specDoc := filepath.Join(fixtureBase, "bugs", "1536", "fixture-1536.yaml") 19 outDir, output := getOutput(t, specDoc, "flatten", "fixture-1536-flat-expand.json") 20 defer os.RemoveAll(outDir) 21 v := &ExpandSpec{ 22 Format: "json", 23 Compact: false, 24 Output: flags.Filename(output), 25 } 26 testProduceOutput(t, v, specDoc, output) 27 } 28 29 func TestCmd_Expand_Error(t *testing.T) { 30 v := &ExpandSpec{} 31 testValidRefs(t, v) 32 }