File: builder_test.go

package info (click to toggle)
golang-github-gucumber-gucumber 0.0~git20160715.0.71608e2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 172 kB
  • ctags: 160
  • sloc: makefile: 10
file content (19 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package gucumber

import (
	"os"
	"path/filepath"
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestPackageImportPathIsExtractedFromFilePath(t *testing.T) {
	//arrange
	packageName := "github.com/username/reponame"
	file := filepath.Join(os.Getenv("GOPATH"), "src/github.com/username/reponame/main.go")
	//act
	importPath := assembleImportPath(file)
	//assert
	assert.Equal(t, packageName, importPath)
}