diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-10 17:51:40 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-10 17:51:40 +0000 |
commit | 4f6779bac7b4e294bc473782d60cbd071f0d0f8d (patch) | |
tree | d37b54da20f8c0adf2d98e810aacc8259b0602ff /test/rubygems/test_gem_dependency_resolver_api_set.rb | |
parent | 31d355aaa9436e2b24efd5e6501cabd876267c46 (diff) | |
download | ruby-4f6779bac7b4e294bc473782d60cbd071f0d0f8d.tar.gz |
* 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_dependency_resolver_api_set.rb')
-rw-r--r-- | test/rubygems/test_gem_dependency_resolver_api_set.rb | 69 |
1 files changed, 8 insertions, 61 deletions
diff --git a/test/rubygems/test_gem_dependency_resolver_api_set.rb b/test/rubygems/test_gem_dependency_resolver_api_set.rb index c1e7eda191..ef99b6ca7f 100644 --- a/test/rubygems/test_gem_dependency_resolver_api_set.rb +++ b/test/rubygems/test_gem_dependency_resolver_api_set.rb @@ -7,73 +7,20 @@ class TestGemDependencyResolverAPISet < Gem::TestCase super @DR = Gem::DependencyResolver - - @api_set = @DR::APISet.new - @uri = 'https://rubygems.org/api/v1/dependencies' - @fetcher = Gem::FakeFetcher.new - Gem::RemoteFetcher.fetcher = @fetcher - end - - def test_find_all - b_entry = { - :name => 'b', - :number => '2', - :platform => 'ruby', - :dependencies => [['a', '>= 0']], - } - - @fetcher.data["#{@uri}?gems=b"] = Marshal.dump [b_entry] - - b_req = @DR::DependencyRequest.new dep('b', '>= 0'), nil - - expected = [ - @DR::APISpecification.new(@api_set, b_entry) - ] - - assert_equal expected, @api_set.find_all(b_req) end - def test_prefetch - b_entry = { - :name => 'b', - :number => '2', - :platform => 'ruby', - :dependencies => [['a', '>= 0']], - } + def test_initialize + set = @DR::APISet.new - a_entry = { - :name => 'a', - :number => '2', - :platform => 'ruby', - :dependencies => [], - } - - @fetcher.data["#{@uri}?gems=a,b"] = Marshal.dump [a_entry, b_entry] - - a_req = @DR::DependencyRequest.new dep('a', '>= 0'), nil - b_req = @DR::DependencyRequest.new dep('b', '>= 0'), nil - - @api_set.prefetch([b_req, a_req]) - - assert_equal [a_entry], @api_set.versions('a') - assert_equal [b_entry], @api_set.versions('b') + assert_equal URI('https://rubygems.org/api/v1/dependencies'), + set.dep_uri end - def test_versions_cache - entry = { - :name => 'b', - :number => '2', - :platform => 'ruby', - :dependencies => [['a', '>= 0']], - } - - @fetcher.data["#{@uri}?gems=b"] = Marshal.dump [entry] - - assert_equal [entry], @api_set.versions('b') - - @fetcher.data["#{@uri}?gems=b"] = 'garbage' + def test_initialize_uri + set = @DR::APISet.new @gem_repo - assert_equal [entry], @api_set.versions('b'), 'version data must be cached' + assert_equal URI('http://gems.example.com/'), + set.dep_uri end end |