diff options
author | Mercedes Bernard <mercedesrbernard@gmail.com> | 2023-02-15 15:07:05 -0600 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2023-02-23 08:50:03 +0000 |
commit | 583137fe5697c0d7119a11caa61c343683dc81e5 (patch) | |
tree | ac493a9f10ceb86ac289b6b617975c6d35b9c402 | |
parent | d5994eb4362d7aba01c36b1b3a1ec3e7462d70d5 (diff) |
[rubygems/rubygems] make Bundler.load_marshal private
https://github.com/rubygems/rubygems/commit/4909d071d2
-rw-r--r-- | lib/bundler.rb | 12 | ||||
-rw-r--r-- | spec/bundler/bundler/bundler_spec.rb | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 68fcff7840..1598397bca 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -525,12 +525,6 @@ EOF load_marshal(data, :marshal_proc => SAFE_MARSHAL_PROC) end - def load_marshal(data, marshal_proc: nil) - Marshal.load(data, marshal_proc) - rescue TypeError => e - raise MarshalError, "#{e.class}: #{e.message}" - end - def load_gemspec(file, validate = false) @gemspec_cache ||= {} key = File.expand_path(file) @@ -619,6 +613,12 @@ EOF private + def load_marshal(data, marshal_proc: nil) + Marshal.load(data, marshal_proc) + rescue TypeError => e + raise MarshalError, "#{e.class}: #{e.message}" + end + def eval_yaml_gemspec(path, contents) Kernel.require "psych" diff --git a/spec/bundler/bundler/bundler_spec.rb b/spec/bundler/bundler/bundler_spec.rb index 5894b4aa12..e0901c36ff 100644 --- a/spec/bundler/bundler/bundler_spec.rb +++ b/spec/bundler/bundler/bundler_spec.rb @@ -5,9 +5,9 @@ require "tmpdir" RSpec.describe Bundler do describe "#load_marshal" do - it "loads any data" do + it "is a private method and raises an error" do data = Marshal.dump(Bundler) - expect(Bundler.load_marshal(data)).to eq(Bundler) + expect { Bundler.load_marshal(data) }.to raise_error(NoMethodError, /private method `load_marshal' called/) end end |