diff options
Diffstat (limited to 'test/rubygems/test_gem_resolver_git_specification.rb')
-rw-r--r-- | test/rubygems/test_gem_resolver_git_specification.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_resolver_git_specification.rb b/test/rubygems/test_gem_resolver_git_specification.rb index d724106f08..b0163bc782 100644 --- a/test/rubygems/test_gem_resolver_git_specification.rb +++ b/test/rubygems/test_gem_resolver_git_specification.rb @@ -46,5 +46,39 @@ class TestGemResolverGitSpecification < Gem::TestCase assert called end + # functional test for Gem::Ext::Builder + + def test_install_extension + name, _, repository, = git_gem 'a', 1 do |s| + s.extensions << 'ext/extconf.rb' + end + + Dir.chdir 'git/a' do + FileUtils.mkdir_p 'ext/lib' + + open 'ext/extconf.rb', 'w' do |io| + io.puts 'require "mkmf"' + io.puts 'create_makefile "a"' + end + + FileUtils.touch 'ext/lib/b.rb' + + system @git, 'add', 'ext/extconf.rb' + system @git, 'add', 'ext/lib/b.rb' + + system @git, 'commit', '--quiet', '-m', 'Add extension files' + end + + source = Gem::Source::Git.new name, repository, 'master', true + + spec = source.specs.first + + git_spec = Gem::Resolver::GitSpecification.new @set, spec, source + + git_spec.install({}) + + assert_path_exists File.join git_spec.spec.extension_install_dir, 'b.rb' + end + end |