Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.
Closed
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
13 changes: 6 additions & 7 deletions spec/bundler/source_list_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
end

describe "#lock_sources" do
it "combines the rubygems sources into a single instance, removing duplicate remotes from the end" do
it "returns each rubygems source" do
source_list.add_git_source("uri" => "git://third-git.org/path.git")
source_list.add_rubygems_source("remotes" => ["https://duplicate-rubygems.org"])
source_list.add_path_source("path" => "/third/path/to/gem")
Expand All @@ -303,15 +303,14 @@
Bundler::Source::Git.new("uri" => "git://first-git.org/path.git"),
Bundler::Source::Git.new("uri" => "git://second-git.org/path.git"),
Bundler::Source::Git.new("uri" => "git://third-git.org/path.git"),
Bundler::Source::Rubygems.new,
Bundler::Source::Rubygems.new("remotes" => ["https://duplicate-rubygems.org"]),
Bundler::Source::Rubygems.new("remotes" => ["https://first-rubygems.org"]),
Bundler::Source::Rubygems.new("remotes" => ["https://second-rubygems.org"]),
Bundler::Source::Rubygems.new("remotes" => ["https://third-rubygems.org"]),
Bundler::Source::Path.new("path" => "/first/path/to/gem"),
Bundler::Source::Path.new("path" => "/second/path/to/gem"),
Bundler::Source::Path.new("path" => "/third/path/to/gem"),
Bundler::Source::Rubygems.new("remotes" => [
"https://duplicate-rubygems.org",
"https://first-rubygems.org",
"https://second-rubygems.org",
"https://third-rubygems.org",
]),
]
end
end
Expand Down
40 changes: 40 additions & 0 deletions spec/lock/lockfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1270,4 +1270,44 @@ def set_lockfile_mtime_to_known_value
expect(err).to match(/your gems.locked contains merge conflicts/i)
expect(err).to match(/git checkout HEAD -- gems.locked/i)
end

it "stores each rubygems source in its own source section" do
build_repo gem_repo3 do
build_gem "cocoapods", "0.37.0"
end

install_gemfile <<-G
source "file://#{gem_repo3}"
source "file://#{gem_repo1}" do
gem "thin" # comes first to test name sorting
gem "rack"
end
gem "cocoapods" # should come from repo3!
G

lockfile_should_be <<-L
GEM
remote: file:#{gem_repo1}/
specs:
rack (1.0.0)
thin (1.0)
rack

GEM
remote: file:#{gem_repo3}/
specs:
cocoapods (0.37.0)

PLATFORMS
ruby

DEPENDENCIES
cocoapods
rack!
thin!

BUNDLED WITH
#{Bundler::VERSION}
L
end
end