From d91ef879966413e00de20eb96863d4d2052a157b Mon Sep 17 00:00:00 2001 From: Andriy Yanko Date: Wed, 25 Nov 2020 18:28:45 +0200 Subject: [PATCH] Fix bug in Bundler::Plugin::API::Source#to_s --- bundler/lib/bundler/plugin/api/source.rb | 2 +- bundler/spec/bundler/plugin/api/source_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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