зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] fix `@license` typo preventing licenses from being correctly unmarshalled
https://github.com/rubygems/rubygems/commit/d6ba7ef79f
This commit is contained in:
Родитель
e69945fc57
Коммит
d6fc8f3d57
|
@ -1318,7 +1318,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||
spec.instance_variable_set :@has_rdoc, array[15]
|
||||
spec.instance_variable_set :@new_platform, array[16]
|
||||
spec.instance_variable_set :@platform, array[16].to_s
|
||||
spec.instance_variable_set :@license, array[17]
|
||||
spec.instance_variable_set :@licenses, [array[17]]
|
||||
spec.instance_variable_set :@metadata, array[18]
|
||||
spec.instance_variable_set :@loaded, false
|
||||
spec.instance_variable_set :@activated, false
|
||||
|
|
|
@ -305,6 +305,18 @@ class TestGemSafeMarshal < Gem::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_gem_spec_unmarshall_license
|
||||
spec = Gem::Specification.new do |s|
|
||||
s.name = "hi"
|
||||
s.version = "1.2.3"
|
||||
s.license = "MIT"
|
||||
end
|
||||
|
||||
unmarshalled_spec = Gem::SafeMarshal.safe_load(Marshal.dump(spec))
|
||||
|
||||
assert_equal ["MIT"], unmarshalled_spec.license
|
||||
end
|
||||
|
||||
def test_gem_spec_disallowed_symbol
|
||||
e = assert_raise(Gem::SafeMarshal::Visitors::ToRuby::UnpermittedSymbolError) do
|
||||
spec = Gem::Specification.new do |s|
|
||||
|
|
Загрузка…
Ссылка в новой задаче