diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-09-29 18:34:12 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-09-29 18:34:12 +0200 |
commit | 2d41c712a73a1b5d85dd8d5bf9134ed1be0e94eb (patch) | |
tree | b34b4cc648c92f72427a6d706fb7d61cdbdd40b2 /spec | |
parent | 59648af296ab15a2e34ebce62a7cc14deb889e7b (diff) | |
download | ruby-2d41c712a73a1b5d85dd8d5bf9134ed1be0e94eb.tar.gz |
Skip default gemspecs spec if the default_specifications_dir cannot be found
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ruby/library/rubygems/gem/bin_path_spec.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/ruby/library/rubygems/gem/bin_path_spec.rb b/spec/ruby/library/rubygems/gem/bin_path_spec.rb index cdf9507bfd..73509e9066 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 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 |