File tree Expand file tree Collapse file tree 4 files changed +14
-9
lines changed Expand file tree Collapse file tree 4 files changed +14
-9
lines changed Original file line number Diff line number Diff line change 449449
450450 allow ( Bundler ::SharedHelpers ) . to receive ( :find_gemfile ) . and_return ( bundled_app_gemfile )
451451 lockfile = Bundler ::LockfileParser . new ( read_lockfile )
452- expect ( lockfile . platforms ) . to match_array ( [ java , x86_mingw32 , local_platform ] . uniq )
452+ expect ( lockfile . platforms ) . to match_array ( default_platform_list ( java , x86_mingw32 ) )
453453 end
454454
455455 it "supports adding new platforms with force_ruby_platform = true" do
481481
482482 allow ( Bundler ::SharedHelpers ) . to receive ( :find_gemfile ) . and_return ( bundled_app_gemfile )
483483 lockfile = Bundler ::LockfileParser . new ( read_lockfile )
484- expect ( lockfile . platforms ) . to match_array ( [ "ruby" , local_platform ] . uniq )
484+ expect ( lockfile . platforms ) . to match_array ( default_platform_list ( "ruby" ) )
485485 end
486486
487487 it "warns when adding an unknown platform" do
494494
495495 allow ( Bundler ::SharedHelpers ) . to receive ( :find_gemfile ) . and_return ( bundled_app_gemfile )
496496 lockfile = Bundler ::LockfileParser . new ( read_lockfile )
497- expect ( lockfile . platforms ) . to match_array ( [ java , x86_mingw32 , local_platform ] . uniq )
497+ expect ( lockfile . platforms ) . to match_array ( default_platform_list ( java , x86_mingw32 ) )
498498
499499 bundle "lock --remove-platform java"
500500
501501 lockfile = Bundler ::LockfileParser . new ( read_lockfile )
502- expect ( lockfile . platforms ) . to match_array ( [ x86_mingw32 , local_platform ] . uniq )
502+ expect ( lockfile . platforms ) . to match_array ( default_platform_list ( x86_mingw32 ) )
503503 end
504504
505505 it "also cleans up redundant platform gems when removing platforms" do
Original file line number Diff line number Diff line change 956956 rack (3.0.7)
957957
958958 PLATFORMS
959- #{ formatted_lockfile_platforms ( * [ "ruby" , generic_local_platform ] . uniq ) }
959+ #{ lockfile_platforms ( "ruby" , generic_local_platform , :defaults => [ ] ) }
960960
961961 DEPENDENCIES
962962 concurrent-ruby
Original file line number Diff line number Diff line change 15211521 indirect_dependency (1.2.3)
15221522
15231523 PLATFORMS
1524- #{ formatted_lockfile_platforms ( * [ "ruby" , generic_local_platform ] . uniq ) }
1524+ #{ lockfile_platforms ( "ruby" , generic_local_platform , :defaults => [ ] ) }
15251525
15261526 DEPENDENCIES
15271527 direct_dependency
Original file line number Diff line number Diff line change @@ -95,12 +95,17 @@ def not_local_patchlevel
9595 9999
9696 end
9797
98- def lockfile_platforms ( *extra )
99- formatted_lockfile_platforms ( local_platform , * extra )
98+ def default_platform_list ( *extra , defaults : default_locked_platforms )
99+ defaults . concat ( extra ) . uniq
100100 end
101101
102- def formatted_lockfile_platforms ( *platforms )
102+ def lockfile_platforms ( *extra , defaults : default_locked_platforms )
103+ platforms = default_platform_list ( *extra , :defaults => defaults )
103104 platforms . map ( &:to_s ) . sort . join ( "\n " )
104105 end
106+
107+ def default_locked_platforms
108+ [ local_platform ]
109+ end
105110 end
106111end
You can’t perform that action at this time.
0 commit comments