Skip to content

Commit 63313dd

Browse files
authored
Merge pull request #2889 from ksss/pathname-collection
Fix: pathname not written to lockfile.
2 parents 9e81252 + 1ef7f41 commit 63313dd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/rbs/collection/config/lockfile_generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ def generate
188188
lockfile.gems[name] = { name: name, version: "0", source: source }
189189
end
190190
return
191-
when 'set', 'pathname'
192-
# set and pathname is migrated to core from stdlib.
191+
when 'set'
192+
# set is migrated to core from stdlib.
193193
RBS.logger.info {
194194
from = from_gem || "rbs_collection.yaml"
195195
"`#{name}` is a part of the Ruby core library. The dependency to the library can be safely deleted from #{from}."

test/rbs/cli_test.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,7 +1484,7 @@ def test_collection_install__pathname_set
14841484
)
14851485

14861486
assert_nil lockfile.gems["set"]
1487-
assert_nil lockfile.gems["pathname"]
1487+
assert_instance_of RBS::Collection::Sources::Stdlib, lockfile.gems["pathname"][:source]
14881488
assert_instance_of RBS::Collection::Sources::Stdlib, lockfile.gems["cgi-escape"][:source]
14891489
assert_instance_of RBS::Collection::Sources::Git, lockfile.gems["ast"][:source]
14901490
end
@@ -1517,15 +1517,14 @@ def test_collection_install__set_pathname__manifest
15171517
_stdout, stderr = run_rbs_collection("install", bundler: true)
15181518

15191519
assert_include stderr, '`set` is a part of the Ruby core library.'
1520-
assert_include stderr, '`pathname` is a part of the Ruby core library.'
15211520

15221521
lockfile = RBS::Collection::Config::Lockfile.from_lockfile(
15231522
lockfile_path: dir + "rbs_collection.lock.yaml",
15241523
data: YAML.safe_load((dir + "rbs_collection.lock.yaml").read)
15251524
)
15261525

15271526
assert_nil lockfile.gems["set"]
1528-
assert_nil lockfile.gems["pathname"]
1527+
assert_instance_of RBS::Collection::Sources::Stdlib, lockfile.gems["pathname"][:source]
15291528
assert_instance_of RBS::Collection::Sources::Stdlib, lockfile.gems["cgi-escape"][:source]
15301529
assert_instance_of RBS::Collection::Sources::Local, lockfile.gems["true_string"][:source]
15311530
end

0 commit comments

Comments
 (0)