diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 21:29:41 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-18 21:29:41 +0000 |
commit | 95683e5cb2d1ab8351402b09ef853dcdf875bf8d (patch) | |
tree | 44500dba22e9aa94ecc5d4fd348512d0fb236501 /test/rubygems/test_gem_commands_query_command.rb | |
parent | 81629f05312cc4df2193a17f13c581eda174d9af (diff) | |
download | ruby-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_query_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_query_command.rb | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_query_command.rb b/test/rubygems/test_gem_commands_query_command.rb index a7e5e01f09..519af595a0 100644 --- a/test/rubygems/test_gem_commands_query_command.rb +++ b/test/rubygems/test_gem_commands_query_command.rb @@ -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 |