diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/dsl_spec.rb | 21 |
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 |