summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_resolver_vendor_specification.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-19 00:34:13 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-19 00:34:13 +0000
commita7fa4d5d9aab150ad4b0c3f3217fe444df69f527 (patch)
tree88ab96d22f7228b556337aa7c34042d4fd279394 /test/rubygems/test_gem_resolver_vendor_specification.rb
parente7ec3dad907f2c77f17faddb40a98b2ef4523222 (diff)
* lib/rubygems: Update to RubyGems master 6a3d9f9. Changes include:
Compatibly renamed Gem::DependencyResolver to Gem::Resolver. Added support for git gems in gem.deps.rb and Gemfile. Fixed resolver bugs. * test/rubygems: ditto. * lib/rubygems/LICENSE.txt: Updated to license from RubyGems trunk. [ruby-trunk - Bug #9086] * lib/rubygems/commands/which_command.rb: RubyGems now indicates failure when any file is missing. [ruby-trunk - Bug #9004] * lib/rubygems/ext/builder: Extensions are now installed into the extension install directory and the first directory in the require path from the gem. This allows backwards compatibility with msgpack and other gems that calculate full require paths. [ruby-trunk - Bug #9106] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_resolver_vendor_specification.rb')
-rw-r--r--test/rubygems/test_gem_resolver_vendor_specification.rb71
1 files changed, 71 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_resolver_vendor_specification.rb b/test/rubygems/test_gem_resolver_vendor_specification.rb
new file mode 100644
index 0000000000..d7aca569e2
--- /dev/null
+++ b/test/rubygems/test_gem_resolver_vendor_specification.rb
@@ -0,0 +1,71 @@
+require 'rubygems/test_case'
+
+class TestGemResolverVendorSpecification < Gem::TestCase
+
+ def setup
+ super
+
+ @set = Gem::Resolver::VendorSet.new
+ @spec = Gem::Specification.new 'a', 1
+ end
+
+ def test_equals2
+ v_spec_a = Gem::Resolver::VendorSpecification.new @set, @spec
+
+ assert_equal v_spec_a, v_spec_a
+
+ spec_b = Gem::Specification.new 'b', 1
+ v_spec_b = Gem::Resolver::VendorSpecification.new @set, spec_b
+
+ refute_equal v_spec_a, v_spec_b
+
+ v_set = Gem::Resolver::VendorSet.new
+ v_spec_s = Gem::Resolver::VendorSpecification.new v_set, @spec
+
+ refute_equal v_spec_a, v_spec_s
+
+ i_set = Gem::Resolver::IndexSet.new
+ source = Gem::Source.new @gem_repo
+ i_spec = Gem::Resolver::IndexSpecification.new(
+ i_set, 'a', v(1), source, Gem::Platform::RUBY)
+
+ refute_equal v_spec_a, i_spec
+ end
+
+ def test_dependencies
+ @spec.add_dependency 'b'
+ @spec.add_dependency 'c'
+
+ v_spec = Gem::Resolver::VendorSpecification.new @set, @spec
+
+ assert_equal [dep('b'), dep('c')], v_spec.dependencies
+ end
+
+ def test_full_name
+ v_spec = Gem::Resolver::VendorSpecification.new @set, @spec
+
+ assert_equal 'a-1', v_spec.full_name
+ end
+
+ def test_name
+ v_spec = Gem::Resolver::VendorSpecification.new @set, @spec
+
+ assert_equal 'a', v_spec.name
+ end
+
+ def test_platform
+ v_spec = Gem::Resolver::VendorSpecification.new @set, @spec
+
+ assert_equal Gem::Platform::RUBY, v_spec.platform
+ end
+
+ def test_version
+ spec = Gem::Specification.new 'a', 1
+
+ v_spec = Gem::Resolver::VendorSpecification.new @set, spec
+
+ assert_equal v(1), v_spec.version
+ end
+
+end
+