summaryrefslogtreecommitdiff
path: root/test/rubygems
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-16 00:43:14 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-16 00:43:14 +0000
commit33d1f172c839bc14ba71a8e74f5ca6b01b7e069b (patch)
treee3f855133bb072667c588712dc86ea51a4092118 /test/rubygems
parent28918eac58eb6e2681d10839ac0d1430b2a4f1f9 (diff)
downloadruby-33d1f172c839bc14ba71a8e74f5ca6b01b7e069b.tar.gz
* lib/rubygems: Update to RubyGems master 278d00d. Changes:
Fixes building extensions without a "clean" make rule Adds gem dependency file autodetection to "gem install -g" * test/rubygems: Tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems')
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb27
-rw-r--r--test/rubygems/test_gem_ext_builder.rb31
-rw-r--r--test/rubygems/test_gem_ext_cmake_builder.rb2
3 files changed, 59 insertions, 1 deletions
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb
index 1008033b6c..24159e4c71 100644
--- a/test/rubygems/test_gem_commands_install_command.rb
+++ b/test/rubygems/test_gem_commands_install_command.rb
@@ -866,5 +866,32 @@ ERROR: Possible alternatives: non_existent_with_hint
assert_match "Installing r (2.0)", @ui.output
end
+ def test_handle_options_file
+ @cmd.handle_options %w[-g Gemfile]
+
+ assert_equal 'Gemfile', @cmd.options[:gemdeps]
+
+ @cmd.handle_options %w[--file gem.deps.rb]
+
+ assert_equal 'gem.deps.rb', @cmd.options[:gemdeps]
+
+ FileUtils.touch 'Isolate'
+
+ @cmd.handle_options %w[-g]
+
+ assert_equal 'Isolate', @cmd.options[:gemdeps]
+
+ FileUtils.touch 'Gemfile'
+
+ @cmd.handle_options %w[-g]
+
+ assert_equal 'Gemfile', @cmd.options[:gemdeps]
+
+ FileUtils.touch 'gem.deps.rb'
+
+ @cmd.handle_options %w[-g]
+
+ assert_equal 'gem.deps.rb', @cmd.options[:gemdeps]
+ end
end
diff --git a/test/rubygems/test_gem_ext_builder.rb b/test/rubygems/test_gem_ext_builder.rb
index ccd1af9d87..aa8eeac2ba 100644
--- a/test/rubygems/test_gem_ext_builder.rb
+++ b/test/rubygems/test_gem_ext_builder.rb
@@ -66,6 +66,37 @@ install:
end
end
+ def test_class_make_no_clean
+ ENV['DESTDIR'] = 'destination'
+ results = []
+
+ Dir.chdir @ext do
+ open 'Makefile', 'w' do |io|
+ io.puts <<-MAKEFILE
+all:
+\t@#{Gem.ruby} -e "puts %Q{all: \#{ENV['DESTDIR']}}"
+
+install:
+\t@#{Gem.ruby} -e "puts %Q{install: \#{ENV['DESTDIR']}}"
+ MAKEFILE
+ end
+
+ Gem::Ext::Builder.make @dest_path, results
+ end
+
+ results = results.join "\n"
+
+ if RUBY_VERSION > '2.0' then
+ assert_match %r%"DESTDIR=#{ENV['DESTDIR']}" clean$%, results
+ assert_match %r%"DESTDIR=#{ENV['DESTDIR']}"$%, results
+ assert_match %r%"DESTDIR=#{ENV['DESTDIR']}" install$%, results
+ else
+ refute_match %r%"DESTDIR=#{ENV['DESTDIR']}" clean$%, results
+ refute_match %r%"DESTDIR=#{ENV['DESTDIR']}"$%, results
+ refute_match %r%"DESTDIR=#{ENV['DESTDIR']}" install$%, results
+ end
+ end
+
def test_build_extensions
@spec.extensions << 'extconf.rb'
diff --git a/test/rubygems/test_gem_ext_cmake_builder.rb b/test/rubygems/test_gem_ext_cmake_builder.rb
index b3e32977f4..aaece6868b 100644
--- a/test/rubygems/test_gem_ext_cmake_builder.rb
+++ b/test/rubygems/test_gem_ext_cmake_builder.rb
@@ -65,7 +65,7 @@ install (FILES test.txt DESTINATION bin)
def test_self_build_has_makefile
File.open File.join(@ext, 'Makefile'), 'w' do |makefile|
- makefile.puts "clean:\n\t@echo ok\nall:\n\t@echo ok\ninstall:\n\t@echo ok"
+ makefile.puts "all:\n\t@echo ok\ninstall:\n\t@echo ok"
end
output = []