Skip to content

Commit 642cc5b

Browse files
authored
Merge pull request #329 from waj/fix/circular-dependencies
Fix detection of circular dependencies
2 parents 1c648e5 + ff93a4e commit 642cc5b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

shard.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ shards:
66

77
molinillo:
88
github: crystal-lang/crystal-molinillo
9-
commit: 00fbe6c5ef9492d56cc7ec7b9a8b9cf2fe1a36ea
9+
commit: 4b78e8c577ac322c8c0363788f3e1109f19668d9
1010

test/integration/install_test.cr

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,18 @@ class InstallCommandTest < Minitest::Test
319319
end
320320
end
321321

322+
def test_fails_with_circular_dependencies
323+
create_git_repository "a"
324+
create_git_release "a", "0.1.0", "name: a\nversion: 0.1.0\ndependencies:\n b:\n git: #{git_path("b")}"
325+
create_git_repository "b"
326+
create_git_release "b", "0.1.0", "name: b\nversion: 0.1.0\ndependencies:\n a:\n git: #{git_path("a")}"
327+
328+
with_shard({dependencies: {a: "*"}}) do
329+
ex = assert_raises(FailedCommand) { run "shards install --no-color" }
330+
assert_match "There is a circular dependency between a and b", ex.stdout
331+
end
332+
end
333+
322334
def test_fails_when_shard_name_doesnt_match
323335
metadata = {
324336
dependencies: {

0 commit comments

Comments
 (0)