Permalink
Browse files

fixes how gem service uri is determined

  • Loading branch information...
1 parent 8a92048 commit 9e05d4a8956f142f183074befb91b1fc10f5aa75 @punkle punkle committed Jan 24, 2014
Showing with 9 additions and 1 deletion.
  1. +1 −1 lib/rubygems/resolver/api_set.rb
  2. +8 −0 test/rubygems/test_gem_resolver_api_set.rb
@@ -30,7 +30,7 @@ def initialize dep_uri = 'https://rubygems.org/api/v1/dependencies'
dep_uri = URI dep_uri unless URI === dep_uri # for ruby 1.8
@dep_uri = dep_uri
- @uri = dep_uri + '../../..'
+ @uri = dep_uri + '../..'
@data = Hash.new { |h,k| h[k] = [] }
@source = Gem::Source.new @uri
@@ -17,6 +17,14 @@ def test_initialize
assert_equal Gem::Source.new(URI('https://rubygems.org')), set.source
end
+ def test_initialize_deeper_uri
+ set = @DR::APISet.new
+
+ assert_equal URI('https://rubygemsserver.com/mygems/api/v1/dependencies'), set.dep_uri
+ assert_equal URI('https://rubygemsserver.com/mygems'), set.uri
+ assert_equal Gem::Source.new(URI('https://rubygemsserver.com/mygems')), set.source
+ end
+
def test_initialize_uri
set = @DR::APISet.new @dep_uri

0 comments on commit 9e05d4a

Please sign in to comment.