Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions bundler/spec/bundler/uri_normalizer_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

RSpec.describe Bundler::URINormalizer do
describe ".normalize_suffix" do
context "when trailing_slash is true" do
it "adds a trailing slash when missing" do
expect(described_class.normalize_suffix("https://example.com", trailing_slash: true)).to eq("https://example.com/")
end

it "keeps the trailing slash when present" do
expect(described_class.normalize_suffix("https://example.com/", trailing_slash: true)).to eq("https://example.com/")
end
end

context "when trailing_slash is false" do
it "removes a trailing slash when present" do
expect(described_class.normalize_suffix("https://example.com/", trailing_slash: false)).to eq("https://example.com")
end

it "keeps the value unchanged when no trailing slash exists" do
expect(described_class.normalize_suffix("https://example.com", trailing_slash: false)).to eq("https://example.com")
end
end
end
end
1 change: 1 addition & 0 deletions bundler/spec/support/windows_tag_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ module WindowsTagGroup
"spec/bundler/resolver/candidate_spec.rb",
"spec/bundler/digest_spec.rb",
"spec/bundler/fetcher/gem_remote_fetcher_spec.rb",
"spec/bundler/uri_normalizer_spec.rb",
],
}.freeze
end
Expand Down