diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-09 23:21:36 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-09 23:21:36 +0000 |
commit | 47f0248b0858898dd24d1e654cedf174059ca677 (patch) | |
tree | 493e84160f8609db408d88349f0624a3ff92c3c2 /test/rubygems/test_gem_stub_specification.rb | |
parent | cd9f9e471977447a991ced4ea38efb2309459ef5 (diff) |
* lib/rubygems: Import RubyGems 2.1
* test/rubygems: Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_stub_specification.rb')
-rw-r--r-- | test/rubygems/test_gem_stub_specification.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_stub_specification.rb b/test/rubygems/test_gem_stub_specification.rb new file mode 100644 index 0000000000..6feb96eb4f --- /dev/null +++ b/test/rubygems/test_gem_stub_specification.rb @@ -0,0 +1,30 @@ +require "rubygems/test_case" +require "rubygems/stub_specification" + +class TestStubSpecification < Gem::TestCase + SPECIFICATIONS = File.expand_path(File.join("..", "specifications"), __FILE__) + FOO = File.join SPECIFICATIONS, "foo-0.0.1.gemspec" + BAR = File.join SPECIFICATIONS, "bar-0.0.2.gemspec" + + def test_basic + stub = Gem::StubSpecification.new(FOO) + assert_equal "foo", stub.name + assert_equal Gem::Version.new("0.0.1"), stub.version + assert_equal Gem::Platform.new("mswin32"), stub.platform + assert_equal ["lib", "lib/f oo/ext"], stub.require_paths + end + + def test_missing_stubline + stub = Gem::StubSpecification.new(BAR) + assert_equal "bar", stub.name + assert_equal Gem::Version.new("0.0.2"), stub.version + assert_equal Gem::Platform.new("ruby"), stub.platform + assert_equal ["lib"], stub.require_paths + end + + def test_to_spec + stub = Gem::StubSpecification.new(FOO) + assert stub.to_spec.is_a?(Gem::Specification) + assert_equal "foo", stub.to_spec.name + end +end |