aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_pristine_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-18 21:29:41 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-18 21:29:41 +0000
commit95683e5cb2d1ab8351402b09ef853dcdf875bf8d (patch)
tree44500dba22e9aa94ecc5d4fd348512d0fb236501 /test/rubygems/test_gem_commands_pristine_command.rb
parent81629f05312cc4df2193a17f13c581eda174d9af (diff)
downloadruby-95683e5cb2d1ab8351402b09ef853dcdf875bf8d.tar.gz
* lib/rubygems: Update to RubyGems 2.2.0.preview.1
This brings several new features to RubyGems summarized here: https://github.com/rubygems/rubygems/blob/v2.2.0.preview.1/History.txt * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_pristine_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_pristine_command.rb54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_pristine_command.rb b/test/rubygems/test_gem_commands_pristine_command.rb
index 78c3f85a5b..1767397d16 100644
--- a/test/rubygems/test_gem_commands_pristine_command.rb
+++ b/test/rubygems/test_gem_commands_pristine_command.rb
@@ -110,6 +110,41 @@ class TestGemCommandsPristineCommand < Gem::TestCase
end
end
+ def test_execute_extensions_explicit
+ a = quick_spec 'a' do |s| s.extensions << 'ext/a/extconf.rb' end
+
+ ext_path = File.join @tempdir, 'ext', 'a', 'extconf.rb'
+ write_file ext_path do |io|
+ io.write <<-'RUBY'
+ File.open "Makefile", "w" do |f|
+ f.puts "all:\n\techo built\n"
+ f.puts "install:\n\techo built\n"
+ end
+ RUBY
+ end
+
+ b = quick_spec 'b'
+
+ install_gem a
+ install_gem b
+
+ @cmd.options[:extensions] = true
+ @cmd.options[:extensions_set] = true
+ @cmd.options[:args] = []
+
+ use_ui @ui do
+ @cmd.execute
+ end
+
+ out = @ui.output.split "\n"
+
+ assert_equal 'Restoring gems to pristine condition...', out.shift
+ assert_equal 'Building native extensions. This could take a while...',
+ out.shift
+ assert_equal "Restored #{a.full_name}", out.shift
+ assert_empty out, out.inspect
+ end
+
def test_execute_no_extension
a = quick_spec 'a' do |s| s.extensions << 'ext/a/extconf.rb' end
@@ -320,5 +355,24 @@ class TestGemCommandsPristineCommand < Gem::TestCase
@ui.output.split("\n"))
assert_empty(@ui.error)
end
+
+ def test_handle_options
+ @cmd.handle_options %w[]
+
+ refute @cmd.options[:all]
+
+ assert @cmd.options[:extensions]
+ refute @cmd.options[:extensions_set]
+
+ assert_equal Gem::Requirement.default, @cmd.options[:version]
+ end
+
+ def test_handle_options_extensions
+ @cmd.handle_options %w[--extensions]
+
+ assert @cmd.options[:extensions]
+ assert @cmd.options[:extensions_set]
+ end
+
end