mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 13:34:17 +02: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
|
@ -281,6 +281,25 @@ pl (1)
|
|||
assert_equal 1, e.exit_code
|
||||
end
|
||||
|
||||
def test_execute_local
|
||||
@cmd.options[:domain] = :local
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
expected = <<-EOF
|
||||
|
||||
*** LOCAL GEMS ***
|
||||
|
||||
a (3.a, 2, 1)
|
||||
pl (1 i386-linux)
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_local_notty
|
||||
@cmd.handle_options %w[]
|
||||
|
||||
|
@ -299,6 +318,23 @@ pl (1 i386-linux)
|
|||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_local_quiet
|
||||
@cmd.options[:domain] = :local
|
||||
Gem.configuration.verbose = false
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
expected = <<-EOF
|
||||
a (3.a, 2, 1)
|
||||
pl (1 i386-linux)
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_no_versions
|
||||
@cmd.handle_options %w[-r --no-versions]
|
||||
|
||||
|
@ -373,6 +409,60 @@ pl (1 i386-linux)
|
|||
assert_equal "WARNING: prereleases are always shown locally\n", @ui.error
|
||||
end
|
||||
|
||||
def test_execute_remote
|
||||
@cmd.options[:domain] = :remote
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
expected = <<-EOF
|
||||
|
||||
*** REMOTE GEMS ***
|
||||
|
||||
a (2)
|
||||
pl (1 i386-linux)
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_remote_notty
|
||||
@cmd.handle_options %w[]
|
||||
|
||||
@ui.outs.tty = false
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
expected = <<-EOF
|
||||
a (3.a, 2, 1)
|
||||
pl (1 i386-linux)
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_remote_quiet
|
||||
@cmd.options[:domain] = :remote
|
||||
Gem.configuration.verbose = false
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
expected = <<-EOF
|
||||
a (2)
|
||||
pl (1 i386-linux)
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_local_details
|
||||
@a1.platform = 'x86-linux'
|
||||
|
||||
|
@ -474,5 +564,18 @@ pl \(1\)
|
|||
assert_equal 'a (2)', entry
|
||||
end
|
||||
|
||||
# Test for multiple args handling!
|
||||
def test_execute_multiple_args
|
||||
@cmd.handle_options %w[a pl]
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_match %r%^a %, @ui.output
|
||||
assert_match %r%^pl %, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue