summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-09-29 18:34:12 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-09-29 18:34:12 +0200
commit2d41c712a73a1b5d85dd8d5bf9134ed1be0e94eb (patch)
treeb34b4cc648c92f72427a6d706fb7d61cdbdd40b2 /spec
parent59648af296ab15a2e34ebce62a7cc14deb889e7b (diff)
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.rb13
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