For local dependencies check if abs path exists

This commit is contained in:
Matthias Loibl 2019-08-12 11:50:56 +02:00
parent e655fcaf60
commit 6ed6c3f3ec
No known key found for this signature in database
GPG key ID: 78A796CA74CA38BA
4 changed files with 11 additions and 8 deletions

View file

@ -49,8 +49,8 @@ func TestInstallCommand(t *testing.T) {
Name: "Relative",
URLs: []string{"test/jsonnet/foobar"},
ExpectedCode: 0,
ExpectedJsonnetFile: []byte(`{"dependencies":null}`),
ExpectedJsonnetLockFile: []byte(`{"dependencies":null}`),
ExpectedJsonnetFile: []byte(`{"dependencies": [{"name": "foobar", "source": {"local": {"directory": "test/jsonnet/foobar"}}, "version": ""}]}`),
ExpectedJsonnetLockFile: []byte(`{"dependencies": [{"name": "foobar", "source": {"local": {"directory": "test/jsonnet/foobar"}}, "version": ""}]}`),
},
}
@ -81,6 +81,8 @@ func TestInstallCommand(t *testing.T) {
}
func jsonnetFileContent(t *testing.T, filename string, content []byte) {
t.Helper()
bytes, err := ioutil.ReadFile(filename)
assert.NoError(t, err)
if eq := assert.JSONEq(t, string(content), string(bytes)); !eq {