mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-11 23:50:05 +01:00
Add ability to parse local dependency
This commit is contained in:
parent
e5199342ea
commit
6ee790d911
2 changed files with 86 additions and 23 deletions
|
|
@ -15,6 +15,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/jsonnet-bundler/jsonnet-bundler/spec"
|
||||
|
|
@ -22,6 +23,13 @@ import (
|
|||
)
|
||||
|
||||
func TestParseDepedency(t *testing.T) {
|
||||
const testFolder = "test/jsonnet/foobar"
|
||||
err := os.MkdirAll(testFolder, os.ModePerm)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll("test")
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
path string
|
||||
|
|
@ -65,6 +73,20 @@ func TestParseDepedency(t *testing.T) {
|
|||
Version: "master",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "local",
|
||||
path: testFolder,
|
||||
want: &spec.Dependency{
|
||||
Name: "foobar",
|
||||
Source: spec.Source{
|
||||
GitSource: &spec.GitSource{
|
||||
Remote: ".",
|
||||
Subdir: "test/jsonnet/foobar",
|
||||
},
|
||||
},
|
||||
Version: ".",
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
_ = t.Run(tt.name, func(t *testing.T) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue