Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rubygems/specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ def self._load(str)
spec.instance_variable_set :@description, array[13]
spec.instance_variable_set :@homepage, array[14]
spec.instance_variable_set :@has_rdoc, array[15]
spec.instance_variable_set :@licenses, [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
Expand Down
14 changes: 13 additions & 1 deletion test/rubygems/test_gem_safe_marshal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,19 @@ def test_gem_spec_unmarshall_license

unmarshalled_spec = Gem::SafeMarshal.safe_load(Marshal.dump(spec))

assert_equal ["MIT"], unmarshalled_spec.license
assert_equal ["MIT"], unmarshalled_spec.licenses
assert_equal "MIT", unmarshalled_spec.license

spec = Gem::Specification.new do |s|
s.name = "hi"
s.version = "1.2.3"
s.licenses = ["MIT", "GPL2"]
end

unmarshalled_spec = Gem::SafeMarshal.safe_load(Marshal.dump(spec))

assert_equal ["MIT", "GPL2"], unmarshalled_spec.licenses
assert_equal "MIT", unmarshalled_spec.license
end

def test_gem_spec_unmarshall_required_ruby_rubygems_version
Expand Down