|
25 | 25 | expect { subject.git_source(:example) }.to raise_error(Bundler::InvalidOption) |
26 | 26 | end |
27 | 27 |
|
28 | | - context "github_https feature flag" do |
29 | | - it "is true when github.https is true" do |
30 | | - bundle "config set github.https true" |
31 | | - expect(Bundler.feature_flag.github_https?).to eq true |
32 | | - end |
33 | | - end |
34 | | - |
35 | | - shared_examples_for "the github DSL" do |protocol| |
36 | | - context "when full repo is used" do |
37 | | - let(:repo) { "indirect/sparks" } |
38 | | - |
39 | | - it "converts :github to URI using #{protocol}" do |
40 | | - subject.gem("sparks", :github => repo) |
41 | | - github_uri = "#{protocol}://github.com/#{repo}.git" |
42 | | - expect(subject.dependencies.first.source.uri).to eq(github_uri) |
43 | | - end |
44 | | - end |
45 | | - |
46 | | - context "when shortcut repo is used" do |
47 | | - let(:repo) { "rails" } |
48 | | - |
49 | | - it "converts :github to URI using #{protocol}" do |
50 | | - subject.gem("sparks", :github => repo) |
51 | | - github_uri = "#{protocol}://github.com/#{repo}/#{repo}.git" |
52 | | - expect(subject.dependencies.first.source.uri).to eq(github_uri) |
53 | | - end |
54 | | - end |
55 | | - end |
56 | | - |
57 | | - context "default hosts (git, gist)" do |
58 | | - context "when github.https config is true" do |
59 | | - before { bundle "config set github.https true" } |
60 | | - |
61 | | - it_behaves_like "the github DSL", "https" |
62 | | - end |
63 | | - |
64 | | - context "when github.https config is false", :bundler => "2" do |
65 | | - before { bundle "config set github.https false" } |
66 | | - |
67 | | - it_behaves_like "the github DSL", "git" |
68 | | - end |
69 | | - |
70 | | - context "when github.https config is false", :bundler => "3" do |
71 | | - before { bundle "config set github.https false" } |
72 | | - |
73 | | - pending "should show a proper message about the removed setting" |
74 | | - end |
75 | | - |
76 | | - context "by default", :bundler => "2" do |
77 | | - it_behaves_like "the github DSL", "https" |
| 28 | + context "default hosts", :bundler => "2" do |
| 29 | + it "converts :github to URI using https" do |
| 30 | + subject.gem("sparks", :github => "indirect/sparks") |
| 31 | + github_uri = "https://github.com/indirect/sparks.git" |
| 32 | + expect(subject.dependencies.first.source.uri).to eq(github_uri) |
78 | 33 | end |
79 | 34 |
|
80 | | - context "by default", :bundler => "3" do |
81 | | - it_behaves_like "the github DSL", "https" |
| 35 | + it "converts :github shortcut to URI using https" do |
| 36 | + subject.gem("sparks", :github => "rails") |
| 37 | + github_uri = "https://github.com/rails/rails.git" |
| 38 | + expect(subject.dependencies.first.source.uri).to eq(github_uri) |
82 | 39 | end |
83 | 40 |
|
84 | 41 | it "converts numeric :gist to :git" do |
|
106 | 63 | end |
107 | 64 | end |
108 | 65 |
|
109 | | - context "default git sources", :bundler => "4" do |
| 66 | + context "default git sources", :bundler => "3" do |
110 | 67 | it "has none" do |
111 | 68 | expect(subject.instance_variable_get(:@git_sources)).to eq({}) |
112 | 69 | end |
|
285 | 242 | end |
286 | 243 | end |
287 | 244 |
|
288 | | - describe "#github", :bundler => "3" do |
| 245 | + describe "#github", :bundler => "2" do |
289 | 246 | it "from github" do |
290 | 247 | spree_gems = %w[spree_core spree_api spree_backend] |
291 | 248 | subject.github "spree" do |
|
299 | 256 | end |
300 | 257 |
|
301 | 258 | describe "#github", :bundler => "3" do |
302 | | - it "from github" do |
303 | | - spree_gems = %w[spree_core spree_api spree_backend] |
304 | | - subject.github "spree" do |
305 | | - spree_gems.each {|spree_gem| subject.send :gem, spree_gem } |
306 | | - end |
307 | | - |
308 | | - subject.dependencies.each do |d| |
309 | | - expect(d.source.uri).to eq("https://github.com/spree/spree.git") |
310 | | - end |
311 | | - end |
312 | | - end |
313 | | - |
314 | | - describe "#github", :bundler => "4" do |
315 | 259 | it "from github" do |
316 | 260 | expect do |
317 | 261 | spree_gems = %w[spree_core spree_api spree_backend] |
|
0 commit comments