[前][次][番号順一覧][スレッド一覧]

ruby-changes:58021

From: Benoit <ko1@a...>
Date: Mon, 30 Sep 2019 01:34:51 +0900 (JST)
Subject: [ruby-changes:58021] 2d41c712a7 (master): Skip default gemspecs spec if the default_specifications_dir cannot be found

https://git.ruby-lang.org/ruby.git/commit/?id=2d41c712a7

From 2d41c712a73a1b5d85dd8d5bf9134ed1be0e94eb Mon Sep 17 00:00:00 2001
From: Benoit Daloze <eregontp@g...>
Date: Sun, 29 Sep 2019 18:34:12 +0200
Subject: Skip default gemspecs spec if the default_specifications_dir cannot
 be found


diff --git a/spec/ruby/library/rubygems/gem/bin_path_spec.rb b/spec/ruby/library/rubygems/gem/bin_path_spec.rb
index cdf9507..73509e9 100644
--- a/spec/ruby/library/rubygems/gem/bin_path_spec.rb
+++ b/spec/ruby/library/rubygems/gem/bin_path_spec.rb
@@ -20,11 +20,16 @@ describe "Gem.bin_path" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/rubygems/gem/bin_path_spec.rb#L20
       default_specifications_dir = Gem::Specification.default_specifications_dir
     end
 
-    Gem::Specification.each_spec([default_specifications_dir]) do |spec|
-      spec.executables.each do |exe|
-        path = Gem.bin_path(spec.name, exe)
-        File.exist?(path).should == true
+    if Dir.exist?(default_specifications_dir)
+      Gem::Specification.each_spec([default_specifications_dir]) do |spec|
+        spec.executables.each do |exe|
+          path = Gem.bin_path(spec.name, exe)
+          File.should.exist?(path)
+        end
       end
+    else
+      # non-installed MRI, there are no default gemspecs
+      1.should == 1
     end
   end
 end
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]