diff options
Diffstat (limited to 'test/rubygems/test_gem_commands_dependency_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_dependency_command.rb | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/test/rubygems/test_gem_commands_dependency_command.rb b/test/rubygems/test_gem_commands_dependency_command.rb index 99b04bcd19..e22b240afe 100644 --- a/test/rubygems/test_gem_commands_dependency_command.rb +++ b/test/rubygems/test_gem_commands_dependency_command.rb @@ -8,8 +8,6 @@ class TestGemCommandsDependencyCommand < Gem::TestCase @cmd = Gem::Commands::DependencyCommand.new @cmd.options[:domain] = :local - - util_setup_fake_fetcher true end def test_execute @@ -30,6 +28,13 @@ class TestGemCommandsDependencyCommand < Gem::TestCase end def test_execute_no_args + spec_fetcher do |fetcher| + fetcher.spec 'a', 1 + fetcher.spec 'a', '2.a' + fetcher.spec 'dep_x', 1, 'x' => '>= 1' + fetcher.legacy_platform + end + @cmd.options[:args] = [] use_ui @ui do @@ -41,23 +46,11 @@ Gem a-1 Gem a-2.a -Gem a-2 - -Gem a-3.a - -Gem a_evil-9 - -Gem b-2 - -Gem c-1.2 - Gem dep_x-1 x (>= 1) Gem pl-1-x86-linux -Gem x-1 - EOF assert_equal expected, @ui.output @@ -78,7 +71,7 @@ Gem x-1 end def test_execute_pipe_format - quick_spec 'foo' do |gem| + util_spec 'foo' do |gem| gem.add_dependency 'bar', '> 1' end @@ -94,6 +87,13 @@ Gem x-1 end def test_execute_regexp + spec_fetcher do |fetcher| + fetcher.spec 'a', 1 + fetcher.spec 'a', '2.a' + fetcher.spec 'a_evil', 9 + fetcher.spec 'b', 2 + end + @cmd.options[:args] = %w[/[ab]/] use_ui @ui do @@ -105,10 +105,6 @@ Gem a-1 Gem a-2.a -Gem a-2 - -Gem a-3.a - Gem a_evil-9 Gem b-2 @@ -187,7 +183,10 @@ ERROR: Only reverse dependencies for local gems are supported. @fetcher = Gem::FakeFetcher.new Gem::RemoteFetcher.fetcher = @fetcher - util_setup_spec_fetcher @a1, @a2 + spec_fetcher do |fetcher| + fetcher.spec 'a', 1 + fetcher.spec 'a', 2 + end @cmd.options[:args] = %w[a] @cmd.options[:domain] = :remote @@ -202,11 +201,9 @@ ERROR: Only reverse dependencies for local gems are supported. end def test_execute_prerelease - @fetcher = Gem::FakeFetcher.new - Gem::RemoteFetcher.fetcher = @fetcher - - util_clear_gems - util_setup_spec_fetcher @a2_pre + spec_fetcher do |fetcher| + fetcher.spec 'a', '2.a' + end @cmd.options[:args] = %w[a] @cmd.options[:domain] = :remote |