diff options
Diffstat (limited to 'test/rubygems/test_gem_request_set_lockfile_parser.rb')
-rw-r--r-- | test/rubygems/test_gem_request_set_lockfile_parser.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/rubygems/test_gem_request_set_lockfile_parser.rb b/test/rubygems/test_gem_request_set_lockfile_parser.rb index afb92e2840..9946c522d9 100644 --- a/test/rubygems/test_gem_request_set_lockfile_parser.rb +++ b/test/rubygems/test_gem_request_set_lockfile_parser.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'rubygems/test_case' require 'rubygems/request_set' require 'rubygems/request_set/lockfile' @@ -246,10 +246,15 @@ DEPENDENCIES assert lockfile_set, 'found a LockSet' - assert_equal %w[a-2 a-2], lockfile_set.specs.map { |s| s.full_name } + assert_equal %w[a-2], lockfile_set.specs.map { |s| s.full_name } - assert_equal %w[https://gems.example/ https://other.example/], - lockfile_set.specs.map { |s| s.source.uri.to_s } + if [].respond_to? :flat_map + assert_equal %w[https://gems.example/ https://other.example/], + lockfile_set.specs.flat_map { |s| s.sources.map{ |src| src.uri.to_s } } + else # FIXME: remove when 1.8 is dropped + assert_equal %w[https://gems.example/ https://other.example/], + lockfile_set.specs.map { |s| s.sources.map{ |src| src.uri.to_s } }.flatten(1) + end end def test_parse_GIT |