[rubygems/rubygems] Make the test_build_extensions
more predictable
The `test_build_extensions` make assumptions about return value of `Gem.install_extension_in_lib`. Givent that RubyGems allow to override this method via `defaults.rb` / `operating_system.rb`, this test might not always pass. This change makes sure that the `Gem.install_extension_in_lib` is predictable. https://github.com/rubygems/rubygems/commit/e83d0a5da8
This commit is contained in:
parent
5454741712
commit
a168426881
@ -106,38 +106,41 @@ install:
|
|||||||
|
|
||||||
def test_build_extensions
|
def test_build_extensions
|
||||||
pend "terminates on mswin" if vc_windows? && ruby_repo?
|
pend "terminates on mswin" if vc_windows? && ruby_repo?
|
||||||
@spec.extensions << "ext/extconf.rb"
|
|
||||||
|
|
||||||
ext_dir = File.join @spec.gem_dir, "ext"
|
extension_in_lib do
|
||||||
|
@spec.extensions << "ext/extconf.rb"
|
||||||
|
|
||||||
FileUtils.mkdir_p ext_dir
|
ext_dir = File.join @spec.gem_dir, "ext"
|
||||||
|
|
||||||
extconf_rb = File.join ext_dir, "extconf.rb"
|
FileUtils.mkdir_p ext_dir
|
||||||
|
|
||||||
File.open extconf_rb, "w" do |f|
|
extconf_rb = File.join ext_dir, "extconf.rb"
|
||||||
f.write <<-'RUBY'
|
|
||||||
require 'mkmf'
|
|
||||||
|
|
||||||
create_makefile 'a'
|
File.open extconf_rb, "w" do |f|
|
||||||
RUBY
|
f.write <<-'RUBY'
|
||||||
|
require 'mkmf'
|
||||||
|
|
||||||
|
create_makefile 'a'
|
||||||
|
RUBY
|
||||||
|
end
|
||||||
|
|
||||||
|
ext_lib_dir = File.join ext_dir, "lib"
|
||||||
|
FileUtils.mkdir ext_lib_dir
|
||||||
|
FileUtils.touch File.join ext_lib_dir, "a.rb"
|
||||||
|
FileUtils.mkdir File.join ext_lib_dir, "a"
|
||||||
|
FileUtils.touch File.join ext_lib_dir, "a", "b.rb"
|
||||||
|
|
||||||
|
use_ui @ui do
|
||||||
|
@builder.build_extensions
|
||||||
|
end
|
||||||
|
|
||||||
|
assert_path_exist @spec.extension_dir
|
||||||
|
assert_path_exist @spec.gem_build_complete_path
|
||||||
|
assert_path_exist File.join @spec.extension_dir, "gem_make.out"
|
||||||
|
assert_path_exist File.join @spec.extension_dir, "a.rb"
|
||||||
|
assert_path_exist File.join @spec.gem_dir, "lib", "a.rb"
|
||||||
|
assert_path_exist File.join @spec.gem_dir, "lib", "a", "b.rb"
|
||||||
end
|
end
|
||||||
|
|
||||||
ext_lib_dir = File.join ext_dir, "lib"
|
|
||||||
FileUtils.mkdir ext_lib_dir
|
|
||||||
FileUtils.touch File.join ext_lib_dir, "a.rb"
|
|
||||||
FileUtils.mkdir File.join ext_lib_dir, "a"
|
|
||||||
FileUtils.touch File.join ext_lib_dir, "a", "b.rb"
|
|
||||||
|
|
||||||
use_ui @ui do
|
|
||||||
@builder.build_extensions
|
|
||||||
end
|
|
||||||
|
|
||||||
assert_path_exist @spec.extension_dir
|
|
||||||
assert_path_exist @spec.gem_build_complete_path
|
|
||||||
assert_path_exist File.join @spec.extension_dir, "gem_make.out"
|
|
||||||
assert_path_exist File.join @spec.extension_dir, "a.rb"
|
|
||||||
assert_path_exist File.join @spec.gem_dir, "lib", "a.rb"
|
|
||||||
assert_path_exist File.join @spec.gem_dir, "lib", "a", "b.rb"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_build_extensions_with_gemhome_with_space
|
def test_build_extensions_with_gemhome_with_space
|
||||||
|
Loading…
x
Reference in New Issue
Block a user