Skip to content

Commit 0ab4d73

Browse files
committed
Test updating specified dependencies only
closes #58
1 parent 7fda97d commit 0ab4d73

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/integration/update_test.cr

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,29 @@ class UpdateCommandTest < Minitest::Test
5454
end
5555
end
5656

57+
def test_updates_specified_dependencies
58+
metadata = { dependencies: {web: "*", orm: "*", optional: "*"}, }
59+
lock = {web: "1.0.0", orm: "0.4.0", optional: "0.2.0"}
60+
61+
with_shard(metadata, lock) do
62+
run "shards update orm optional"
63+
64+
# keeps unspecified dependencies:
65+
assert_installed "web", "1.0.0"
66+
assert_locked "web", "1.0.0"
67+
68+
# updates specified dependencies:
69+
assert_installed "orm", "0.5.0"
70+
assert_locked "orm", "0.5.0"
71+
assert_installed "optional", "0.2.2"
72+
assert_locked "optional", "0.2.2"
73+
74+
# installs additional dependencies:
75+
assert_installed "pg", "0.2.1"
76+
assert_locked "pg", "0.2.1"
77+
end
78+
end
79+
5780
def test_wont_install_prerelease_version
5881
metadata = { dependencies: {unstable: "*"} }
5982
lock = {unstable: "0.1.0"}

0 commit comments

Comments
 (0)