ruby-changes:61071
From: Josef <ko1@a...>
Date: Fri, 8 May 2020 07:39:41 +0900 (JST)
Subject: [ruby-changes:61071] 832a7b0458 (master): [rubygems/rubygems] Add gem build test to check for removed methods.
https://git.ruby-lang.org/ruby.git/commit/?id=832a7b0458 From 832a7b04589578b52297db6a9943e0c6c003fbfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=A0im=C3=A1nek?= <josef.simanek@g...> Date: Sun, 19 Apr 2020 18:16:41 +0200 Subject: [rubygems/rubygems] Add gem build test to check for removed methods. https://github.com/rubygems/rubygems/commit/c07b9cf4f1 diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index b5c377f..f1f6b85 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -110,6 +110,8 @@ class Gem::TestCase < Minitest::Test https://github.com/ruby/ruby/blob/trunk/lib/rubygems/test_case.rb#L110 TEST_PATH = ENV.fetch('RUBYGEMS_TEST_PATH', File.expand_path('../../../test/rubygems', __FILE__)) + SPECIFICATIONS = File.expand_path(File.join(TEST_PATH, "specifications"), __FILE__) + def assert_activate(expected, *specs) specs.each do |spec| case spec diff --git a/test/rubygems/specifications/rubyforge-0.0.1.gemspec b/test/rubygems/specifications/rubyforge-0.0.1.gemspec new file mode 100644 index 0000000..0df2c4c --- /dev/null +++ b/test/rubygems/specifications/rubyforge-0.0.1.gemspec @@ -0,0 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/test/rubygems/specifications/rubyforge-0.0.1.gemspec#L1 +# -*- encoding: utf-8 -*- + +Gem::Specification.new do |s| + s.name = "rubyforge" + s.version = "0.0.1" + s.platform = "ruby" + s.require_paths = ["lib"] + s.summary = "A very bar gem" + s.authors = ["unknown"] + s.license = 'MIT' + s.homepage = 'http://example.com' + s.files = ['README.md'] + s.rubyforge_project = 'abc' +end diff --git a/test/rubygems/test_gem_commands_build_command.rb b/test/rubygems/test_gem_commands_build_command.rb index 9dfba75..76ede14 100644 --- a/test/rubygems/test_gem_commands_build_command.rb +++ b/test/rubygems/test_gem_commands_build_command.rb @@ -127,6 +127,23 @@ class TestGemCommandsBuildCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_build_command.rb#L127 util_test_build_gem @gem end + def test_execute_rubyforge_project_warning + rubyforge_gemspec = File.join SPECIFICATIONS, "rubyforge-0.0.1.gemspec" + + @cmd.options[:args] = [rubyforge_gemspec] + + use_ui @ui do + Dir.chdir @tempdir do + @cmd.execute + end + end + + error = @ui.error.split("\n") + assert_equal "WARNING: rubyforge_project= is deprecated and ignored. Please remove this from your gemspec to ensure that your gem continues to build in the future.", error.shift + assert_equal "WARNING: See https://guides.rubygems.org/specification-reference/ for help", error.shift + assert_equal [], error + end + def test_execute_strict_with_warnings bad_gem = util_spec 'some_bad_gem' do |s| s.files = ['README.md'] diff --git a/test/rubygems/test_gem_stub_specification.rb b/test/rubygems/test_gem_stub_specification.rb index 8553194..91a46d7 100644 --- a/test/rubygems/test_gem_stub_specification.rb +++ b/test/rubygems/test_gem_stub_specification.rb @@ -4,7 +4,6 @@ require "rubygems/stub_specification" https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_stub_specification.rb#L4 class TestStubSpecification < Gem::TestCase - SPECIFICATIONS = File.expand_path(File.join("..", "specifications"), __FILE__) FOO = File.join SPECIFICATIONS, "foo-0.0.1-x86-mswin32.gemspec" BAR = File.join SPECIFICATIONS, "bar-0.0.2.gemspec" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/