Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bundler::Plugin::API::Source#to_s having empty source type #4084

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundler/lib/bundler/plugin/api/source.rb
Expand Up @@ -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}"
Copy link
Contributor Author

@ayanko ayanko Nov 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use instance variables to be consistent with #to_lock implementation.

end

# Note: Do not override if you don't know what you are doing.
Expand Down
6 changes: 6 additions & 0 deletions bundler/spec/bundler/plugin/api/source_spec.rb
Expand Up @@ -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