aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_ext_ext_conf_builder.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 22:46:50 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-22 22:46:50 +0000
commit4c2304f0004e9f1784540f3d36976aad9eab1f68 (patch)
treefe5d7f52b7e01644d0a57316aab03299ed0ee5c8 /test/rubygems/test_gem_ext_ext_conf_builder.rb
parent66cc0fa4abde68ae360ba2d2cdf4e44bc833e33a (diff)
downloadruby-4c2304f0004e9f1784540f3d36976aad9eab1f68.tar.gz
* lib/rubygems: Import RubyGems from master as of commit b165260
* test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_ext_ext_conf_builder.rb')
-rw-r--r--test/rubygems/test_gem_ext_ext_conf_builder.rb41
1 files changed, 40 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_ext_ext_conf_builder.rb b/test/rubygems/test_gem_ext_ext_conf_builder.rb
index 3703e6b63b..33398ac6f3 100644
--- a/test/rubygems/test_gem_ext_ext_conf_builder.rb
+++ b/test/rubygems/test_gem_ext_ext_conf_builder.rb
@@ -27,7 +27,10 @@ class TestGemExtExtConfBuilder < Gem::TestCase
output = []
Dir.chdir @ext do
- Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
+ result =
+ Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
+
+ assert_same result, output
end
assert_match(/^#{Gem.ruby} extconf.rb/, output[0])
@@ -108,6 +111,42 @@ checking for main\(\) in .*?nonexistent/m, error.message)
assert_equal("#{Gem.ruby} extconf.rb", output[0])
end
+ def test_class_build_unconventional
+ if vc_windows? && !nmake_found?
+ skip("test_class_build skipped - nmake not found")
+ end
+
+ File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
+ extconf.puts <<-'EXTCONF'
+include RbConfig
+
+ruby_exe = "#{CONFIG['RUBY_INSTALL_NAME']}#{CONFIG['EXEEXT']}"
+ruby = File.join CONFIG['bindir'], ruby_exe
+
+open 'Makefile', 'w' do |io|
+ io.write <<-Makefile
+all: ruby
+install: ruby
+
+ruby:
+\t#{ruby} -e0
+
+ Makefile
+end
+ EXTCONF
+ end
+
+ output = []
+
+ Dir.chdir @ext do
+ Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
+ end
+
+ assert_contains_make_command '', output[2]
+ assert_contains_make_command 'install', output[4]
+ assert_empty Dir.glob(File.join(@ext, 'siteconf*.rb'))
+ end
+
def test_class_make
if vc_windows? && !nmake_found?
skip("test_class_make skipped - nmake not found")