File: builder_test.go

package info (click to toggle)
golang-github-lsegal-gucumber 0.0~git20160110.0.44a4d7e-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 164 kB
  • sloc: makefile: 10
file content (19 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (3)
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)
}