mirror of
https://github.com/ruby/ruby.git
synced 2025-08-25 14:05:02 +02:00
[rubygems/rubygems] add safe_load_marshal for gem::version and gem::spec
2ea2ead1b3
This commit is contained in:
parent
e965133f56
commit
10a393c25d
1 changed files with 12 additions and 0 deletions
|
@ -27,6 +27,18 @@ RSpec.describe Bundler do
|
|||
data = Marshal.dump(simple_structure)
|
||||
expect(Bundler.safe_load_marshal(data)).to eq(simple_structure)
|
||||
end
|
||||
|
||||
it "loads Gem::Version" do
|
||||
gem_version = Gem::Version.new("3.7.2")
|
||||
data = Marshal.dump(gem_version)
|
||||
expect(Bundler.safe_load_marshal(data)).to eq(gem_version)
|
||||
end
|
||||
|
||||
it "loads Gem::Specification" do
|
||||
gem_spec = Gem::Specification.new("name", "3.7.2")
|
||||
data = Marshal.dump(gem_spec)
|
||||
expect(Bundler.safe_load_marshal(data)).to eq(gem_spec)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#load_gemspec_uncached" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue