Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

Commit

Permalink
Resolve Local Dependencies From Bundle Path
Browse files Browse the repository at this point in the history
Fixes #22
  • Loading branch information
David McKay authored and SeanTAllen committed Aug 9, 2018
1 parent fdc38b9 commit 08bcc47
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion stable/dep.pony
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class DepLocal
end

fun root_path(): String =>
local_path
Path.join(bundle.path.path, local_path)

fun packages_path(): String =>
root_path()
Expand Down
4 changes: 2 additions & 2 deletions stable/test/integration/test_env.pony
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class TestEnvBundleInSameDir is UnitTest

let expected =
try
"../local/a" + ":" +
Path.join(tmp.path, "../local/a") + ":" +
tmp.join(".deps/-local-git-b16798852821555717647")?.path + ":" +
tmp.join(".deps/github/c")?.path + ":" +
tmp.join(".deps/gitlab/d")?.path
Expand Down Expand Up @@ -193,7 +193,7 @@ class TestEnvBundleInParentDir is UnitTest
]}\n"), "prepare bundle.json")

let notifier: ProcessNotify iso = _ExpectClient(h,
["PONYPATH=../local/a"],
["PONYPATH=" + Path.join(tmp.path, "../local/a")],
None,
0)
_Exec(h, "stable env", nested.path, consume notifier)
Expand Down
5 changes: 3 additions & 2 deletions stable/test/test_dep.pony
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ class TestDep is UnitTest

info = JsonObject.from_map(local)
dep = Dep(bundle, info)?
h.assert_eq[String]("../foo/bar", dep.root_path())
h.assert_eq[String]("../foo/bar", dep.packages_path())

h.assert_eq[String](Path.join(bundle.path.path, "../foo/bar"), dep.root_path())
h.assert_eq[String](Path.join(bundle.path.path, "../foo/bar"), dep.packages_path())

let incomplete_local = Map[String, JsonType]
incomplete_local("type") = "local"
Expand Down

0 comments on commit 08bcc47

Please sign in to comment.