diff options
| author | Drew Stevenson <drew@soona.co> | 2023-11-30 22:35:33 -0600 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-12-14 00:06:05 +0000 |
| commit | beefce1444adafac484bb69b625de2b30e7e80d2 (patch) | |
| tree | 5c3318fecd5ba177253e24ffa62446fd23a1a4e3 /test | |
| parent | d7dad644658697a05949b66e736a34fb772771de (diff) | |
[rubygems/rubygems] Warn for duplicate meta data links
Match order of METADATA_LINK_KEYS to order used by rubygems.org in Links model.
Add missing download_uri key.
https://github.com/rubygems/rubygems/commit/d2922cd6e9
Diffstat (limited to 'test')
| -rw-r--r-- | test/rubygems/test_gem_specification.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_specification.rb b/test/rubygems/test_gem_specification.rb index f586da94a6..5601f286a9 100644 --- a/test/rubygems/test_gem_specification.rb +++ b/test/rubygems/test_gem_specification.rb @@ -3644,6 +3644,38 @@ Did you mean 'Ruby'? end end + def test_metadata_link_validation_warns_for_duplicates + util_setup_validate + + Dir.chdir @tempdir do + @m2 = quick_gem "m", "2" do |s| + s.files = %w[lib/code.rb] + s.licenses = "BSD-2-Clause" + s.metadata = { + "source_code_uri" => "http://example.com", + "homepage_uri" => "http://example.com", + "changelog_uri" => "http://example.com/changelog", + } + end + + use_ui @ui do + @m2.validate + end + + expected = <<~EXPECTED + #{w}: You have specified the uri: + http://example.com + for all of the following keys: + homepage_uri + source_code_uri + Only the first one will be shown on rubygems.org + #{w}: See https://guides.rubygems.org/specification-reference/ for help + EXPECTED + + assert_equal expected, @ui.error, "warning" + end + end + def test_metadata_specs @m1 = quick_gem "m", "1" do |s| s.files = %w[lib/code.rb] |
