diff --git a/bundler/lib/bundler/plugin/api/source.rb b/bundler/lib/bundler/plugin/api/source.rb index 56e97f4aa415..e1f0826874d0 100644 --- a/bundler/lib/bundler/plugin/api/source.rb +++ b/bundler/lib/bundler/plugin/api/source.rb @@ -260,7 +260,7 @@ def to_lock end def to_s - "plugin source for #{options[:type]} with uri #{uri}" + "plugin source for #{@type} with uri #{@uri}" end # Note: Do not override if you don't know what you are doing. diff --git a/bundler/spec/bundler/plugin/api/source_spec.rb b/bundler/spec/bundler/plugin/api/source_spec.rb index 2c50ff56a43a..428ceb220a03 100644 --- a/bundler/spec/bundler/plugin/api/source_spec.rb +++ b/bundler/spec/bundler/plugin/api/source_spec.rb @@ -79,4 +79,10 @@ end end end + + describe "to_s" do + it "returns the string with type and uri" do + expect(source.to_s).to eq("plugin source for spec_type with uri uri://to/test") + end + end end