ruby-changes:62219
From: MSP-Greg <ko1@a...>
Date: Wed, 15 Jul 2020 16:05:33 +0900 (JST)
Subject: [ruby-changes:62219] 23cf99e99d (master): [rubygems/rubygems] Bundler specs - Windows - remove skips, File.open => File.readlines
https://git.ruby-lang.org/ruby.git/commit/?id=23cf99e99d From 23cf99e99dbae352f8497fb20cc92248c9b63580 Mon Sep 17 00:00:00 2001 From: MSP-Greg <Greg.mpls@g...> Date: Wed, 17 Jun 2020 21:26:13 -0500 Subject: [rubygems/rubygems] Bundler specs - Windows - remove skips, File.open => File.readlines Using File.open without a block leaves a file reference that causes issues with file operations commands/binstubs_spec.rb install/gems/compact_index_spec.rb install/gems/dependency_api_spec.rb install/gems/standalone_spec.rb runtime/executable_spec.rb https://github.com/rubygems/rubygems/commit/4b9a6ca156 diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb index 81e7817..2af5839 100644 --- a/spec/bundler/commands/binstubs_spec.rb +++ b/spec/bundler/commands/binstubs_spec.rb @@ -75,7 +75,6 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L75 context "when generating bundle binstub outside bundler" do it "should abort" do - skip "Unknown issue" if Gem.win_platform? install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" gem "rack" @@ -285,8 +284,7 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L284 G bundle "binstubs rack --shebang jruby" - - expect(File.open(bundled_app("bin/rackup")).gets).to eq("#!/usr/bin/env jruby\n") + expect(File.readlines(bundled_app("bin/rackup")).first).to eq("#!/usr/bin/env jruby\n") end end end diff --git a/spec/bundler/install/gems/compact_index_spec.rb b/spec/bundler/install/gems/compact_index_spec.rb index e5ec9cc..72b2f92 100644 --- a/spec/bundler/install/gems/compact_index_spec.rb +++ b/spec/bundler/install/gems/compact_index_spec.rb @@ -522,8 +522,6 @@ The checksum of /versions does not match the checksum provided by the server! So https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gems/compact_index_spec.rb#L522 end it "installs the binstubs", :bundler => "< 3" do - skip "exec format error" if Gem.win_platform? - gemfile <<-G source "#{source_uri}" gem "rack" diff --git a/spec/bundler/install/gems/dependency_api_spec.rb b/spec/bundler/install/gems/dependency_api_spec.rb index 5aa4c9a..da16ace 100644 --- a/spec/bundler/install/gems/dependency_api_spec.rb +++ b/spec/bundler/install/gems/dependency_api_spec.rb @@ -496,8 +496,6 @@ RSpec.describe "gemcutter's dependency API" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gems/dependency_api_spec.rb#L496 end it "installs the binstubs", :bundler => "< 3" do - skip "exec format error" if Gem.win_platform? - gemfile <<-G source "#{source_uri}" gem "rack" diff --git a/spec/bundler/install/gems/standalone_spec.rb b/spec/bundler/install/gems/standalone_spec.rb index d41cffd..503cc4a 100644 --- a/spec/bundler/install/gems/standalone_spec.rb +++ b/spec/bundler/install/gems/standalone_spec.rb @@ -281,14 +281,10 @@ RSpec.shared_examples "bundle install --standalone" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/install/gems/standalone_spec.rb#L281 include_examples "common functionality" it "creates stubs that use the standalone load path" do - skip "exec format error" if Gem.win_platform? - expect(sys_exec("bin/rails -v").chomp).to eql "2.3.2" end it "creates stubs that can be executed from anywhere" do - skip "exec format error" if Gem.win_platform? - require "tmpdir" sys_exec(%(#{bundled_app("bin/rails")} -v), :dir => Dir.tmpdir) expect(out).to eq("2.3.2") diff --git a/spec/bundler/runtime/executable_spec.rb b/spec/bundler/runtime/executable_spec.rb index 98077ef..0f0226f 100644 --- a/spec/bundler/runtime/executable_spec.rb +++ b/spec/bundler/runtime/executable_spec.rb @@ -9,8 +9,6 @@ RSpec.describe "Running bin/* commands" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/executable_spec.rb#L9 end it "runs the bundled command when in the bundle" do - skip "exec format error" if Gem.win_platform? - bundle "binstubs rack" build_gem "rack", "2.0", :to_system => true do |s| @@ -22,8 +20,6 @@ RSpec.describe "Running bin/* commands" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/executable_spec.rb#L20 end it "allows the location of the gem stubs to be specified" do - skip "created in bin :/" if Gem.win_platform? - bundle "binstubs rack", :path => "gbin" expect(bundled_app("bin")).not_to exist @@ -34,8 +30,6 @@ RSpec.describe "Running bin/* commands" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/executable_spec.rb#L30 end it "allows absolute paths as a specification of where to install bin stubs" do - skip "exec format error" if Gem.win_platform? - bundle "binstubs rack", :path => tmp("bin") gembin tmp("bin/rackup") @@ -44,19 +38,15 @@ RSpec.describe "Running bin/* commands" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/executable_spec.rb#L38 it "uses the default ruby install name when shebang is not specified" do bundle "binstubs rack" - expect(File.open(bundled_app("bin/rackup")).gets).to eq("#!/usr/bin/env #{RbConfig::CONFIG["ruby_install_name"]}\n") + expect(File.readlines(bundled_app("bin/rackup")).first).to eq("#!/usr/bin/env #{RbConfig::CONFIG["ruby_install_name"]}\n") end it "allows the name of the shebang executable to be specified" do - skip "not created with custom name :/" if Gem.win_platform? - bundle "binstubs rack", :shebang => "ruby-foo" - expect(File.open(bundled_app("bin/rackup")).gets).to eq("#!/usr/bin/env ruby-foo\n") + expect(File.readlines(bundled_app("bin/rackup")).first).to eq("#!/usr/bin/env ruby-foo\n") end it "runs the bundled command when out of the bundle" do - skip "exec format error" if Gem.win_platform? - bundle "binstubs rack" build_gem "rack", "2.0", :to_system => true do |s| @@ -68,8 +58,6 @@ RSpec.describe "Running bin/* commands" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/executable_spec.rb#L58 end it "works with gems in path" do - skip "exec format error" if Gem.win_platform? - build_lib "rack", :path => lib_path("rack") do |s| s.executables = "rackup" end @@ -100,8 +88,6 @@ RSpec.describe "Running bin/* commands" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/executable_spec.rb#L88 end it "does not generate bin stubs if the option was not specified" do - skip "generated :/" if Gem.win_platform? - bundle "install" expect(bundled_app("bin/rackup")).not_to exist @@ -153,8 +139,6 @@ RSpec.describe "Running bin/* commands" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/executable_spec.rb#L139 end it "use BUNDLE_GEMFILE gemfile for binstub" do - skip "exec format error" if Gem.win_platform? - # context with bin/bundler w/ default Gemfile bundle "binstubs bundler" -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/