mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Add gem build test to check for removed methods.
https://github.com/rubygems/rubygems/commit/c07b9cf4f1
This commit is contained in:
parent
856cbbdd52
commit
832a7b0458
Notes:
git
2020-05-08 07:39:24 +09:00
4 changed files with 33 additions and 1 deletions
|
@ -110,6 +110,8 @@ class Gem::TestCase < Minitest::Test
|
|||
|
||||
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
|
||||
|
|
14
test/rubygems/specifications/rubyforge-0.0.1.gemspec
Normal file
14
test/rubygems/specifications/rubyforge-0.0.1.gemspec
Normal file
|
@ -0,0 +1,14 @@
|
|||
# -*- 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
|
|
@ -127,6 +127,23 @@ class TestGemCommandsBuildCommand < Gem::TestCase
|
|||
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']
|
||||
|
|
|
@ -4,7 +4,6 @@ require "rubygems/stub_specification"
|
|||
|
||||
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"
|
||||
|
||||
|
|
Loading…
Reference in a new issue