mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
81629f0531
commit
95683e5cb2
25 changed files with 540 additions and 159 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue