summaryrefslogtreecommitdiff
path: root/spec/bundler
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-27 12:08:19 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-27 12:08:19 +0000
commitfc9509bdd246a1817119af5cfa4dc36de992b35a (patch)
treefa094229e46b0f4588bdfec215265b09999178d4 /spec/bundler
parent86cb3d319f8a9b39deaad9acc6863e6c5c854eac (diff)
Merge bundler-2.0.0.pre.2 from upstream.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/bundler')
-rw-r--r--spec/bundler/bundler/dsl_spec.rb16
-rw-r--r--spec/bundler/other/major_deprecation_spec.rb8
2 files changed, 20 insertions, 4 deletions
diff --git a/spec/bundler/bundler/dsl_spec.rb b/spec/bundler/bundler/dsl_spec.rb
index dcc816eee2..94d54ad877 100644
--- a/spec/bundler/bundler/dsl_spec.rb
+++ b/spec/bundler/bundler/dsl_spec.rb
@@ -25,7 +25,23 @@ RSpec.describe Bundler::Dsl do
expect { subject.git_source(:example) }.to raise_error(Bundler::InvalidOption)
end
+ context "github_https feature flag" do
+ it "is true when github.https is true" do
+ bundle "config github.https true"
+ expect(Bundler.feature_flag.github_https?).to eq "true"
+ end
+ end
+
context "default hosts (git, gist)", :bundler => "< 3" do
+ context "when github.https config is true" do
+ before { bundle "config github.https true" }
+ it "converts :github to :git using https" do
+ subject.gem("sparks", :github => "indirect/sparks")
+ github_uri = "https://github.com/indirect/sparks.git"
+ expect(subject.dependencies.first.source.uri).to eq(github_uri)
+ end
+ end
+
it "converts :github to :git" do
subject.gem("sparks", :github => "indirect/sparks")
github_uri = "git://github.com/indirect/sparks.git"
diff --git a/spec/bundler/other/major_deprecation_spec.rb b/spec/bundler/other/major_deprecation_spec.rb
index 32827dbd54..50800dbb0c 100644
--- a/spec/bundler/other/major_deprecation_spec.rb
+++ b/spec/bundler/other/major_deprecation_spec.rb
@@ -200,7 +200,7 @@ RSpec.describe "major deprecations", :bundler => "< 3" do
context "with github gems" do
it "warns about the https change" do
msg = <<-EOS
-The :github git source is deprecated, and will be removed in Bundler 2.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
+The :github git source is deprecated, and will be removed in Bundler 3.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" }
@@ -212,7 +212,7 @@ The :github git source is deprecated, and will be removed in Bundler 2.0. Change
it "upgrades to https on request" do
Bundler.settings.temporary "github.https" => true
msg = <<-EOS
-The :github git source is deprecated, and will be removed in Bundler 2.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
+The :github git source is deprecated, and will be removed in Bundler 3.0. Change any "reponame" :github sources to "username/reponame". Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:github) {|repo_name| "https://github.com/\#{repo_name}.git" }
@@ -229,7 +229,7 @@ The :github git source is deprecated, and will be removed in Bundler 2.0. Change
it "warns about removal" do
allow(Bundler.ui).to receive(:deprecate)
msg = <<-EOS
-The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add this code to the top of your Gemfile to ensure it continues to work:
+The :bitbucket git source is deprecated, and will be removed in Bundler 3.0. Add this code to the top of your Gemfile to ensure it continues to work:
git_source(:bitbucket) do |repo_name|
user_name, repo_name = repo_name.split("/")
@@ -247,7 +247,7 @@ The :bitbucket git source is deprecated, and will be removed in Bundler 2.0. Add
it "warns about removal" do
allow(Bundler.ui).to receive(:deprecate)
msg = "The :gist git source is deprecated, and will be removed " \
- "in Bundler 2.0. Add this code to the top of your Gemfile to ensure it " \
+ "in Bundler 3.0. Add this code to the top of your Gemfile to ensure it " \
"continues to work:\n\n git_source(:gist) {|repo_name| " \
"\"https://gist.github.com/\#{repo_name}.git\" }\n\n"
expect(Bundler::SharedHelpers).to receive(:major_deprecation).with(3, msg)