1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-09-29 19:56:15 +02:00
parent 869e4f6e4c
commit 54d49aeb52
2 changed files with 15 additions and 12 deletions

View file

@ -171,6 +171,7 @@ SpecificExampleException
Specs Specs
StrChild StrChild
StrangeEach StrangeEach
StringIO
StringRefinement StringRefinement
StringScanner StringScanner
StringSubclass StringSubclass

View file

@ -11,21 +11,23 @@ describe "Gem.bin_path" do
ENV['BUNDLE_GEMFILE'] = @bundle_gemfile ENV['BUNDLE_GEMFILE'] = @bundle_gemfile
end end
it "finds executables of default gems, which are the only files shipped for default gems" do guard_not -> { platform_is :windows and ruby_version_is "2.5"..."2.6" } do
# For instance, Gem.bin_path("bundler", "bundle") is used by rails new it "finds executables of default gems, which are the only files shipped for default gems" do
# For instance, Gem.bin_path("bundler", "bundle") is used by rails new
if Gem.respond_to? :default_specifications_dir if Gem.respond_to? :default_specifications_dir
default_specifications_dir = Gem.default_specifications_dir default_specifications_dir = Gem.default_specifications_dir
else else
default_specifications_dir = Gem::Specification.default_specifications_dir default_specifications_dir = Gem::Specification.default_specifications_dir
end end
skip "Could not find the default gemspecs" unless Dir.exist?(default_specifications_dir) skip "Could not find the default gemspecs" unless Dir.exist?(default_specifications_dir)
Gem::Specification.each_spec([default_specifications_dir]) do |spec| Gem::Specification.each_spec([default_specifications_dir]) do |spec|
spec.executables.each do |exe| spec.executables.each do |exe|
path = Gem.bin_path(spec.name, exe) path = Gem.bin_path(spec.name, exe)
File.should.exist?(path) File.should.exist?(path)
end
end end
end end
end end