Skip to content

Commit

Permalink
Import package without dot (onsi#687)
Browse files Browse the repository at this point in the history
Fixes onsi#683
  • Loading branch information
alex-slynko authored Jun 9, 2020
1 parent 21eaef2 commit 6321024
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ginkgo/generate_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
{{if .IncludeImports}}. "github.com/onsi/ginkgo"{{end}}
{{if .IncludeImports}}. "github.com/onsi/gomega"{{end}}
{{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}}
{{if .ImportPackage}}"{{.PackageImportPath}}"{{end}}
)
var _ = Describe("{{.Subject}}", func() {
Expand All @@ -55,7 +55,7 @@ import (
"github.com/sclevine/agouti"
. "github.com/sclevine/agouti/matchers"
{{if .DotImportPackage}}. "{{.PackageImportPath}}"{{end}}
{{if .ImportPackage}}"{{.PackageImportPath}}"{{end}}
)
var _ = Describe("{{.Subject}}", func() {
Expand All @@ -78,7 +78,7 @@ type specData struct {
Subject string
PackageImportPath string
IncludeImports bool
DotImportPackage bool
ImportPackage bool
}

func generateSpec(args []string, agouti, noDot, internal bool) {
Expand Down Expand Up @@ -119,7 +119,7 @@ func generateSpecForSubject(subject string, agouti, noDot, internal bool) error
Subject: formattedName,
PackageImportPath: getPackageImportPath(),
IncludeImports: !noDot,
DotImportPackage: !internal,
ImportPackage: !internal,
}

targetFile := fmt.Sprintf("%s_test.go", specFilePrefix)
Expand Down

0 comments on commit 6321024

Please sign in to comment.