diff options
Diffstat (limited to 'spec/bundler/bundler/dsl_spec.rb')
-rw-r--r-- | spec/bundler/bundler/dsl_spec.rb | 78 |
1 files changed, 11 insertions, 67 deletions
diff --git a/spec/bundler/bundler/dsl_spec.rb b/spec/bundler/bundler/dsl_spec.rb index de2a43adc6..214d159d05 100644 --- a/spec/bundler/bundler/dsl_spec.rb +++ b/spec/bundler/bundler/dsl_spec.rb @@ -25,60 +25,17 @@ 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 set github.https true" - expect(Bundler.feature_flag.github_https?).to eq true - end - end - - shared_examples_for "the github DSL" do |protocol| - context "when full repo is used" do - let(:repo) { "indirect/sparks" } - - it "converts :github to URI using #{protocol}" do - subject.gem("sparks", :github => repo) - github_uri = "#{protocol}://github.com/#{repo}.git" - expect(subject.dependencies.first.source.uri).to eq(github_uri) - end - end - - context "when shortcut repo is used" do - let(:repo) { "rails" } - - it "converts :github to URI using #{protocol}" do - subject.gem("sparks", :github => repo) - github_uri = "#{protocol}://github.com/#{repo}/#{repo}.git" - expect(subject.dependencies.first.source.uri).to eq(github_uri) - end - end - end - - context "default hosts (git, gist)" do - context "when github.https config is true" do - before { bundle "config set github.https true" } - - it_behaves_like "the github DSL", "https" - end - - context "when github.https config is false", :bundler => "2" do - before { bundle "config set github.https false" } - - it_behaves_like "the github DSL", "git" - end - - context "when github.https config is false", :bundler => "3" do - before { bundle "config set github.https false" } - - pending "should show a proper message about the removed setting" - end - - context "by default", :bundler => "2" do - it_behaves_like "the github DSL", "https" + context "default hosts", :bundler => "2" do + it "converts :github to URI 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 - context "by default", :bundler => "3" do - it_behaves_like "the github DSL", "https" + it "converts :github shortcut to URI using https" do + subject.gem("sparks", :github => "rails") + github_uri = "https://github.com/rails/rails.git" + expect(subject.dependencies.first.source.uri).to eq(github_uri) end it "converts numeric :gist to :git" do @@ -106,7 +63,7 @@ RSpec.describe Bundler::Dsl do end end - context "default git sources", :bundler => "4" do + context "default git sources", :bundler => "3" do it "has none" do expect(subject.instance_variable_get(:@git_sources)).to eq({}) end @@ -285,7 +242,7 @@ RSpec.describe Bundler::Dsl do end end - describe "#github", :bundler => "3" do + describe "#github", :bundler => "2" do it "from github" do spree_gems = %w[spree_core spree_api spree_backend] subject.github "spree" do @@ -300,19 +257,6 @@ RSpec.describe Bundler::Dsl do describe "#github", :bundler => "3" do it "from github" do - spree_gems = %w[spree_core spree_api spree_backend] - subject.github "spree" do - spree_gems.each {|spree_gem| subject.send :gem, spree_gem } - end - - subject.dependencies.each do |d| - expect(d.source.uri).to eq("https://github.com/spree/spree.git") - end - end - end - - describe "#github", :bundler => "4" do - it "from github" do expect do spree_gems = %w[spree_core spree_api spree_backend] subject.github "spree" do |