This repository has been archived by the owner on Jun 25, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix and add tests for box paths relative to an imported package
- Loading branch information
Showing
7 changed files
with
77 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package importPkg | ||
|
||
import ( | ||
"github.com/gobuffalo/packr/v2" | ||
) | ||
|
||
var BoxTestNew = packr.New("pkg_test", "./pkg_test") | ||
var BoxTestNewBox = packr.NewBox("./pkg_test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package importPkg | ||
|
||
import ( | ||
"github.com/gobuffalo/packr/v2" | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
func Test_NewBox(t *testing.T) { | ||
r := require.New(t) | ||
|
||
box := packr.NewBox("./pkg_test") | ||
r.Len(box.List(), 2) | ||
} | ||
|
||
func Test_New(t *testing.T) { | ||
r := require.New(t) | ||
|
||
box := packr.New("pkg_test", "./pkg_test") | ||
r.Len(box.List(), 2) | ||
} |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package packr_test | ||
|
||
import ( | ||
"github.com/gobuffalo/packr/v2/_fixtures/importPkg" | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
func Test_ImportWithBox(t *testing.T) { | ||
r := require.New(t) | ||
|
||
r.Len(importPkg.BoxTestNew.List(), 2) | ||
|
||
r.Len(importPkg.BoxTestNewBox.List(), 2) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters