diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-08 14:19:04 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-13 07:54:37 +0900 |
commit | 0e60b59d5884edb8f9aea023efd9b24f1ff02049 (patch) | |
tree | e52935ce510440872ca5ce6b0e092cbc94f18bc9 /spec/bundler/install/gemfile/gemspec_spec.rb | |
parent | 68224651a4d4dc3ce0cea666f5423dd8b6ba6cfc (diff) |
Update the bundler version with master branch
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3086
Diffstat (limited to 'spec/bundler/install/gemfile/gemspec_spec.rb')
-rw-r--r-- | spec/bundler/install/gemfile/gemspec_spec.rb | 69 |
1 files changed, 27 insertions, 42 deletions
diff --git a/spec/bundler/install/gemfile/gemspec_spec.rb b/spec/bundler/install/gemfile/gemspec_spec.rb index 26a6235166..b42587c65f 100644 --- a/spec/bundler/install/gemfile/gemspec_spec.rb +++ b/spec/bundler/install/gemfile/gemspec_spec.rb @@ -117,21 +117,19 @@ RSpec.describe "bundle install from an existing gemspec" do build_lib("foo", :path => tmp.join("foo")) do |s| s.write("Gemfile", "source '#{file_uri_for(gem_repo1)}'\ngemspec") s.add_dependency "actionpack", "=2.3.2" - s.add_development_dependency "rake", "=12.3.2" + s.add_development_dependency "rake", "=13.0.1" end - Dir.chdir(tmp.join("foo")) do - bundle "install" - # This should really be able to rely on $stderr, but, it's not written - # right, so we can't. In fact, this is a bug negation test, and so it'll - # ghost pass in future, and will only catch a regression if the message - # doesn't change. Exit codes should be used correctly (they can be more - # than just 0 and 1). - output = bundle("install --deployment") - expect(output).not_to match(/You have added to the Gemfile/) - expect(output).not_to match(/You have deleted from the Gemfile/) - expect(output).not_to match(/install in deployment mode after changing/) - end + bundle "install", :dir => tmp.join("foo") + # This should really be able to rely on $stderr, but, it's not written + # right, so we can't. In fact, this is a bug negation test, and so it'll + # ghost pass in future, and will only catch a regression if the message + # doesn't change. Exit codes should be used correctly (they can be more + # than just 0 and 1). + output = bundle("install --deployment", :dir => tmp.join("foo")) + expect(output).not_to match(/You have added to the Gemfile/) + expect(output).not_to match(/You have deleted from the Gemfile/) + expect(output).not_to match(/install in deployment mode after changing/) end it "should match a lockfile without needing to re-resolve" do @@ -169,15 +167,12 @@ RSpec.describe "bundle install from an existing gemspec" do expect(out.scan(message).size).to eq(1) end - it "should match a lockfile on non-ruby platforms with a transitive platform dependency" do - simulate_platform java - simulate_ruby_engine "jruby" - + it "should match a lockfile on non-ruby platforms with a transitive platform dependency", :jruby do build_lib("foo", :path => tmp.join("foo")) do |s| s.add_dependency "platform_specific" end - system_gems "platform_specific-1.0-java", :path => :bundle_path, :keep_path => true + system_gems "platform_specific-1.0-java", :path => default_bundle_path, :keep_path => true install_gemfile! <<-G gemspec :path => '#{tmp.join("foo")}' @@ -201,7 +196,7 @@ RSpec.describe "bundle install from an existing gemspec" do it "allows the gemspec to activate other gems" do ENV["BUNDLE_PATH__SYSTEM"] = "true" - # see https://github.com/bundler/bundler/issues/5409 + # see https://github.com/rubygems/bundler/issues/5409 # # issue was caused by rubygems having an unresolved gem during a require, # so emulate that @@ -333,6 +328,8 @@ RSpec.describe "bundle install from an existing gemspec" do let(:platform) { "ruby" } before do + skip "not installing for some reason" if Gem.win_platform? + build_lib("foo", :path => tmp.join("foo")) do |s| s.add_dependency "rack", "=1.0.0" end @@ -365,13 +362,11 @@ RSpec.describe "bundle install from an existing gemspec" do L end - context "using JRuby with explicit platform" do - let(:platform) { "java" } - + context "using JRuby with explicit platform", :jruby do before do create_file( - tmp.join("foo", "foo-#{platform}.gemspec"), - build_spec("foo", "1.0", platform) do + tmp.join("foo", "foo-java.gemspec"), + build_spec("foo", "1.0", "java") do dep "rack", "=1.0.0" @spec.authors = "authors" @spec.summary = "summary" @@ -380,27 +375,17 @@ RSpec.describe "bundle install from an existing gemspec" do end it "should install" do - simulate_ruby_engine "jruby" do - simulate_platform "java" do - results = bundle "install", :artifice => "endpoint" - expect(results).to include("Installing rack 1.0.0") - expect(the_bundle).to include_gems "rack 1.0.0" - end - end + results = bundle "install", :artifice => "endpoint" + expect(results).to include("Installing rack 1.0.0") + expect(the_bundle).to include_gems "rack 1.0.0" end end - context "using JRuby" do - let(:platform) { "java" } - + context "using JRuby", :jruby do it "should install" do - simulate_ruby_engine "jruby" do - simulate_platform "java" do - results = bundle "install", :artifice => "endpoint" - expect(results).to include("Installing rack 1.0.0") - expect(the_bundle).to include_gems "rack 1.0.0" - end - end + results = bundle "install", :artifice => "endpoint" + expect(results).to include("Installing rack 1.0.0") + expect(the_bundle).to include_gems "rack 1.0.0" end end @@ -425,7 +410,7 @@ RSpec.describe "bundle install from an existing gemspec" do end end - build_lib "foo", :path => "." do |s| + build_lib "foo", :path => bundled_app do |s| if platform_specific_type == :runtime s.add_runtime_dependency dependency elsif platform_specific_type == :development |