summaryrefslogtreecommitdiff
path: root/spec/bundler
diff options
context:
space:
mode:
authorMercedes Bernard <mercedesrbernard@gmail.com>2023-02-16 13:44:07 -0600
committergit <svn-admin@ruby-lang.org>2023-02-23 08:50:04 +0000
commit68995c21bed067c068e84ffc16181aee1c2f4fc9 (patch)
tree020c8d985db16d65e635b3ae0c49e51651291b45 /spec/bundler
parentffc202738b02d781fe2cf7542806d11a4eb47035 (diff)
downloadruby-68995c21bed067c068e84ffc16181aee1c2f4fc9.tar.gz
[rubygems/rubygems] test rubygems_integration that error raised when attempting load unexpected class
https://github.com/rubygems/rubygems/commit/9798718b3b
Diffstat (limited to 'spec/bundler')
-rw-r--r--spec/bundler/bundler/rubygems_integration_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/bundler/bundler/rubygems_integration_spec.rb b/spec/bundler/bundler/rubygems_integration_spec.rb
index 369f28fcef..182aa3646a 100644
--- a/spec/bundler/bundler/rubygems_integration_spec.rb
+++ b/spec/bundler/bundler/rubygems_integration_spec.rb
@@ -89,5 +89,16 @@ RSpec.describe Bundler::RubygemsIntegration do
expect(result).to eq(%w[specs prerelease_specs])
end
end
+
+ context "when loading an unexpected class" do
+ let(:remote_no_mirror) { double("remote", :uri => uri, :original_uri => nil) }
+ let(:unexpected_specs_response) { Marshal.dump(3) }
+
+ it "raises a MarshalError error" do
+ expect(Bundler.rubygems).to receive(:gem_remote_fetcher).once.and_return(fetcher)
+ expect(fetcher).to receive(:fetch_path).with(uri + "specs.4.8.gz").and_return(unexpected_specs_response)
+ expect { Bundler.rubygems.fetch_all_remote_specs(remote_no_mirror) }.to raise_error(Bundler::MarshalError, /unexpected class/i)
+ end
+ end
end
end