summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-06-27 17:39:34 +0200
committerSamuel Giddins <segiddins@segiddins.me>2017-06-28 13:42:45 +0200
commit5d257f1b3b2223a79db565948cefd9f4a5599c0a (patch)
treeaae2c3d46d4b0a918870cdb8300bc0ada1ccde49 /spec
parent34234e5e67425fa5d1e857d436846175b6a3b3df (diff)
downloadbundler-seg-no-default-git-sources.tar.gz
[DSL] Remove default git sources on 2.0seg-no-default-git-sources
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/dsl_spec.rb21
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/bundler/dsl_spec.rb b/spec/bundler/dsl_spec.rb
index 5b811ff322..080723ac83 100644
--- a/spec/bundler/dsl_spec.rb
+++ b/spec/bundler/dsl_spec.rb
@@ -25,7 +25,7 @@ RSpec.describe Bundler::Dsl do
expect { subject.git_source(:example) }.to raise_error(Bundler::InvalidOption)
end
- context "default hosts (git, gist)" do
+ context "default hosts (git, gist)", :bundler => "< 2" do
it "converts :github to :git" do
subject.gem("sparks", :github => "indirect/sparks")
github_uri = "git://github.com/indirect/sparks.git"
@@ -62,6 +62,12 @@ RSpec.describe Bundler::Dsl do
expect(subject.dependencies.first.source.uri).to eq(bitbucket_uri)
end
end
+
+ context "default git sources", :bundler => "2" do
+ it "has none" do
+ expect(subject.instance_variable_get(:@git_sources)).to eq({})
+ end
+ end
end
describe "#method_missing" do
@@ -218,7 +224,7 @@ RSpec.describe Bundler::Dsl do
# gem 'spree_api'
# gem 'spree_backend'
# end
- describe "#github" do
+ describe "#github", :bundler => "< 2" do
it "from github" do
spree_gems = %w[spree_core spree_api spree_backend]
subject.github "spree" do
@@ -230,6 +236,17 @@ RSpec.describe Bundler::Dsl do
end
end
end
+
+ describe "#github", :bundler => "2" do
+ it "from github" do
+ expect 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
+ end.to raise_error(Bundler::DeprecatedError, /github method has been removed/)
+ end
+ end
end
describe "syntax errors" do