diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-01 21:50:14 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-07-01 21:50:14 +0000 |
commit | effdbf5936cc090a618e13c8f9a1b5412ebab2fa (patch) | |
tree | c8410a18cbbe7ad013470fc06fef0c75ce0fd230 /test/rubygems/test_gem_stub_specification.rb | |
parent | 9c4ef4b191a1e6b9abdbb21c7c709d1d0f2397e6 (diff) | |
download | ruby-effdbf5936cc090a618e13c8f9a1b5412ebab2fa.tar.gz |
* lib/rubygems: Update to RubyGems HEAD(c202db2).
this version contains many enhancements see http://git.io/vtNwF
* test/rubygems: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51092 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 | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/test/rubygems/test_gem_stub_specification.rb b/test/rubygems/test_gem_stub_specification.rb index 9d273125a5..e1ab8342dd 100644 --- a/test/rubygems/test_gem_stub_specification.rb +++ b/test/rubygems/test_gem_stub_specification.rb @@ -9,7 +9,7 @@ class TestStubSpecification < Gem::TestCase def setup super - @foo = Gem::StubSpecification.new FOO + @foo = Gem::StubSpecification.gemspec_stub FOO end def test_initialize @@ -31,7 +31,7 @@ class TestStubSpecification < Gem::TestCase end def test_initialize_missing_stubline - stub = Gem::StubSpecification.new(BAR) + stub = Gem::StubSpecification.gemspec_stub(BAR) assert_equal "bar", stub.name assert_equal Gem::Version.new("0.0.2"), stub.version assert_equal Gem::Platform.new("ruby"), stub.platform @@ -72,6 +72,21 @@ class TestStubSpecification < Gem::TestCase assert_equal expected, stub.full_require_paths end + def test_lib_dirs_glob + stub = stub_without_extension + + assert_equal File.join(stub.full_gem_path, 'lib'), stub.lib_dirs_glob + end + + def test_matches_for_glob + stub = stub_without_extension + code_rb = File.join stub.gem_dir, 'lib', 'code.rb' + FileUtils.mkdir_p File.dirname code_rb + FileUtils.touch code_rb + + assert_equal code_rb, stub.matches_for_glob('code*').first + end + def test_missing_extensions_eh stub = stub_with_extension do |s| extconf_rb = File.join s.gem_dir, s.extensions.first @@ -103,7 +118,7 @@ class TestStubSpecification < Gem::TestCase io.write spec.to_ruby_for_cache end - default_spec = Gem::StubSpecification.new spec.loaded_from + default_spec = Gem::StubSpecification.gemspec_stub spec.loaded_from refute default_spec.missing_extensions? end @@ -125,7 +140,7 @@ class TestStubSpecification < Gem::TestCase def test_to_spec_with_other_specs_loaded_does_not_warn real_foo = util_spec @foo.name, @foo.version real_foo.activate - bar = Gem::StubSpecification.new BAR + bar = Gem::StubSpecification.gemspec_stub BAR refute_predicate Gem.loaded_specs, :empty? assert bar.to_spec end @@ -164,7 +179,7 @@ end io.flush - stub = Gem::StubSpecification.new io.path + stub = Gem::StubSpecification.gemspec_stub io.path yield stub if block_given? @@ -187,7 +202,7 @@ end io.flush - stub = Gem::StubSpecification.new io.path + stub = Gem::StubSpecification.gemspec_stub io.path yield stub if block_given? |