From a325b06697c1635ed7a51e4858e5758ee259df4f Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 10 Jun 2024 12:32:02 +0200 Subject: [PATCH] Update spec for allowed_push_host for different destination --- spec/ddtrace/release_gem_spec.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/spec/ddtrace/release_gem_spec.rb b/spec/ddtrace/release_gem_spec.rb index 24e39941e6f..90a89a8df51 100644 --- a/spec/ddtrace/release_gem_spec.rb +++ b/spec/ddtrace/release_gem_spec.rb @@ -112,13 +112,24 @@ describe '#metadata' do it do { - 'allowed_push_host' => 'https://rubygems.org', 'changelog_uri' => "https://github.com/DataDog/dd-trace-rb/blob/v#{gemspec.version}/CHANGELOG.md", 'source_code_uri' => "https://github.com/DataDog/dd-trace-rb/tree/v#{gemspec.version}" }.each do |key, value| expect(gemspec.metadata[key]).to eq(value) end end + + # `allowed_push_host` is overwritten by automated scripts + # in order to publish to another destination repository. + context 'allowed_push_host' do + it { expect(gemspec.metadata).to have_key('allowed_push_host') } + + it do + expect(gemspec.metadata['allowed_push_host']) + .to eq('https://rubygems.org') + .or eq('https://rubygems.pkg.github.com/DataDog') + end + end end end end