summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gemfile/gemspec_spec.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-14 06:01:35 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-14 06:01:35 +0000
commit68ddd4d300e9a88737c4f37af74e1a0312949b2f (patch)
tree787e1e83d76934ce039eb336995a8d5bb53a89e6 /spec/bundler/install/gemfile/gemspec_spec.rb
parentd636809c057432e8d42abe30c6c6785eb0721d77 (diff)
Merge Bundler 2.1.0.pre.1 as developed version from upstream.
https://github.com/bundler/bundler/commit/a53709556b95a914e874b22ed2116a46b0528852 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/bundler/install/gemfile/gemspec_spec.rb')
-rw-r--r--spec/bundler/install/gemfile/gemspec_spec.rb123
1 files changed, 18 insertions, 105 deletions
diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb
index bbb56da5a4..0bec2e9d96 100644
--- a/spec/bundler/install/gemfile/gemspec_spec.rb
+++ b/spec/bundler/install/gemfile/gemspec_spec.rb
@@ -117,7 +117,7 @@ RSpec.describe "bundle install from an existing gemspec" do
build_lib("foo", :path => tmp.join("foo")) do |s|
s.write("Gemfile", "source 'file://#{gem_repo1}'\ngemspec")
s.add_dependency "actionpack", "=2.3.2"
- s.add_development_dependency "rake", "=10.0.2"
+ s.add_development_dependency "rake", "=12.3.2"
end
Dir.chdir(tmp.join("foo")) do
@@ -239,7 +239,7 @@ RSpec.describe "bundle install from an existing gemspec" do
expect(the_bundle).to include_gems "foo 1.0.0"
end
- it "does not break Gem.finish_resolve with conflicts", :rubygems => ">= 2" do
+ it "does not break Gem.finish_resolve with conflicts" do
build_lib("foo", :path => tmp.join("foo")) do |s|
s.version = "1.0.0"
s.add_dependency "bar", "= 1.0.0"
@@ -263,6 +263,20 @@ RSpec.describe "bundle install from an existing gemspec" do
expect(out).to eq("WIN")
end
+ it "works with only_update_to_newer_versions" do
+ build_lib "omg", "2.0", :path => lib_path("omg")
+
+ install_gemfile <<-G
+ gemspec :path => "#{lib_path("omg")}"
+ G
+
+ build_lib "omg", "1.0", :path => lib_path("omg")
+
+ bundle! :install, :env => { "BUNDLE_BUNDLE_ONLY_UPDATE_TO_NEWER_VERSIONS" => "true" }
+
+ expect(the_bundle).to include_gems "omg 1.0"
+ end
+
context "in deployment mode" do
context "when the lockfile was not updated after a change to the gemspec's dependencies" do
it "reports that installation failed" do
@@ -283,7 +297,7 @@ RSpec.describe "bundle install from an existing gemspec" do
bundle :install, forgotten_command_line_options(:deployment => true)
- expect(out).to include("changed")
+ expect(err).to include("changed")
end
end
end
@@ -433,7 +447,7 @@ RSpec.describe "bundle install from an existing gemspec" do
end
end
- context "on ruby", :bundler => "< 3" do
+ context "on ruby" do
before do
simulate_platform("ruby")
bundle :install
@@ -533,107 +547,6 @@ RSpec.describe "bundle install from an existing gemspec" do
end
end
end
-
- context "on ruby", :bundler => "3" do
- before do
- simulate_platform("ruby")
- bundle :install
- end
-
- context "as a runtime dependency" do
- it "keeps java dependencies in the lockfile" do
- expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
- expect(lockfile).to eq normalize_uri_file(strip_whitespace(<<-L))
- GEM
- remote: file://localhost#{gem_repo2}/
- specs:
- platform_specific (1.0)
- platform_specific (1.0-java)
-
- PATH
- remote: .
- specs:
- foo (1.0)
- platform_specific
-
- PLATFORMS
- java
- ruby
-
- DEPENDENCIES
- foo!
-
- BUNDLED WITH
- #{Bundler::VERSION}
- L
- end
- end
-
- context "as a development dependency" do
- let(:platform_specific_type) { :development }
-
- it "keeps java dependencies in the lockfile" do
- expect(the_bundle).to include_gems "foo 1.0", "platform_specific 1.0 RUBY"
- expect(lockfile).to eq normalize_uri_file(strip_whitespace(<<-L))
- GEM
- remote: file://localhost#{gem_repo2}/
- specs:
- platform_specific (1.0)
- platform_specific (1.0-java)
-
- PATH
- remote: .
- specs:
- foo (1.0)
-
- PLATFORMS
- java
- ruby
-
- DEPENDENCIES
- foo!
- platform_specific
-
- BUNDLED WITH
- #{Bundler::VERSION}
- L
- end
- end
-
- context "with an indirect platform-specific development dependency" do
- let(:platform_specific_type) { :development }
- let(:dependency) { "indirect_platform_specific" }
-
- it "keeps java dependencies in the lockfile" do
- expect(the_bundle).to include_gems "foo 1.0", "indirect_platform_specific 1.0", "platform_specific 1.0 RUBY"
- expect(lockfile).to eq normalize_uri_file(strip_whitespace(<<-L))
- GEM
- remote: file://localhost#{gem_repo2}/
- specs:
- indirect_platform_specific (1.0)
- platform_specific
- platform_specific (1.0)
- platform_specific (1.0-java)
-
- PATH
- remote: .
- specs:
- foo (1.0)
-
- PLATFORMS
- java
- ruby
-
- DEPENDENCIES
- foo!
- indirect_platform_specific
-
- BUNDLED WITH
- #{Bundler::VERSION}
- L
- end
- end
- end
end
end