summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_specification_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-10 17:51:40 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-10 17:51:40 +0000
commit4f6779bac7b4e294bc473782d60cbd071f0d0f8d (patch)
treed37b54da20f8c0adf2d98e810aacc8259b0602ff /test/rubygems/test_gem_commands_specification_command.rb
parent31d355aaa9436e2b24efd5e6501cabd876267c46 (diff)
* lib/rubygems: Update to RubyGems master 4bdc4f2. Important changes
in this commit: RubyGems now chooses the test server port reliably. Patch by akr. Partial implementation of bundler's Gemfile format. Refactorings to improve the new resolver. Fixes bugs in the resolver. * test/rubygems: Tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_specification_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_specification_command.rb53
1 files changed, 17 insertions, 36 deletions
diff --git a/test/rubygems/test_gem_commands_specification_command.rb b/test/rubygems/test_gem_commands_specification_command.rb
index 252d0bdd55..fb28302cc3 100644
--- a/test/rubygems/test_gem_commands_specification_command.rb
+++ b/test/rubygems/test_gem_commands_specification_command.rb
@@ -152,14 +152,9 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
end
def test_execute_remote
- foo = quick_gem 'foo'
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- util_setup_spec_fetcher foo
-
- FileUtils.rm File.join(@gemhome, 'specifications', foo.spec_name)
+ spec_fetcher do |fetcher|
+ fetcher.spec 'foo', 1
+ end
@cmd.options[:args] = %w[foo]
@cmd.options[:domain] = :remote
@@ -173,16 +168,10 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
end
def test_execute_remote_with_version
- foo1 = quick_gem 'foo', "1"
- foo2 = quick_gem 'foo', "2"
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- util_setup_spec_fetcher foo1, foo2
-
- FileUtils.rm File.join(@gemhome, 'specifications', foo1.spec_name)
- FileUtils.rm File.join(@gemhome, 'specifications', foo2.spec_name)
+ spec_fetcher do |fetcher|
+ fetcher.spec 'foo', "1"
+ fetcher.spec 'foo', "2"
+ end
@cmd.options[:args] = %w[foo]
@cmd.options[:version] = "1"
@@ -198,16 +187,12 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
end
def test_execute_remote_without_prerelease
- foo = new_spec 'foo', '2.0.0'
- foo_pre = new_spec 'foo', '2.0.1.pre'
-
- install_specs foo, foo_pre
+ spec_fetcher do |fetcher|
+ foo = fetcher.spec 'foo', '2.0.0'
+ foo_pre = fetcher.spec 'foo', '2.0.1.pre'
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- util_setup_spec_fetcher foo
- util_setup_spec_fetcher foo_pre
+ install_specs foo, foo_pre
+ end
@cmd.options[:args] = %w[foo]
@cmd.options[:domain] = :remote
@@ -225,16 +210,12 @@ class TestGemCommandsSpecificationCommand < Gem::TestCase
end
def test_execute_remote_with_prerelease
- foo = new_spec 'foo', '2.0.0'
- foo_pre = new_spec 'foo', '2.0.1.pre'
+ spec_fetcher do |fetcher|
+ foo = fetcher.spec 'foo', '2.0.0'
+ foo_pre = fetcher.spec 'foo', '2.0.1.pre'
- install_specs foo, foo_pre
-
- @fetcher = Gem::FakeFetcher.new
- Gem::RemoteFetcher.fetcher = @fetcher
-
- util_setup_spec_fetcher foo
- util_setup_spec_fetcher foo_pre
+ install_specs foo, foo_pre
+ end
@cmd.options[:args] = %w[foo]
@cmd.options[:domain] = :remote