diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-14 03:30:02 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-14 03:30:02 +0000 |
commit | 4de117a61517e839f2c45eaf45d56fc243d6d5b2 (patch) | |
tree | 7cb5af7a7eb513e5dddf5e343746b1611e628387 /test/rubygems/test_gem_source_git.rb | |
parent | e548c09d429a5136285ea81aed418685359ed124 (diff) | |
download | ruby-4de117a61517e839f2c45eaf45d56fc243d6d5b2.tar.gz |
* lib/rubygems: Update to RubyGems 2.4.1 master(713ab65)
Complete history at:
https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216
* test/rubygems: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_source_git.rb')
-rw-r--r-- | test/rubygems/test_gem_source_git.rb | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb index 58bff84490..cf5f088c03 100644 --- a/test/rubygems/test_gem_source_git.rb +++ b/test/rubygems/test_gem_source_git.rb @@ -27,6 +27,21 @@ class TestGemSourceGit < Gem::TestCase assert_path_exists File.join @source.install_dir, 'a.gemspec' end + def test_checkout_master + Dir.chdir @repository do + system @git, 'checkout', '-q', '-b', 'other' + system @git, 'mv', 'a.gemspec', 'b.gemspec' + system @git, 'commit', '-q', '-a', '-m', 'rename gemspec' + system @git, 'checkout', '-q', 'master' + end + + @source = Gem::Source::Git.new @name, @repository, 'other', false + + @source.checkout + + assert_path_exists File.join @source.install_dir, 'b.gemspec' + end + def test_checkout_local @source.remote = false @@ -179,14 +194,18 @@ class TestGemSourceGit < Gem::TestCase git = Gem::Source::Git.new 'a', 'git/a', 'master', false remote = Gem::Source.new @gem_repo installed = Gem::Source::Installed.new + vendor = Gem::Source::Vendor.new 'vendor/foo' assert_equal( 0, git. <=>(git), 'git <=> git') assert_equal( 1, git. <=>(remote), 'git <=> remote') assert_equal(-1, remote. <=>(git), 'remote <=> git') - assert_equal( 1, installed.<=>(git), 'installed <=> git') - assert_equal(-1, git. <=>(installed), 'git <=> installed') + assert_equal( 1, git. <=>(installed), 'git <=> installed') + assert_equal(-1, installed.<=>(git), 'installed <=> git') + + assert_equal(-1, git. <=>(vendor), 'git <=> vendor') + assert_equal( 1, vendor. <=>(git), 'vendor <=> git') end def test_specs @@ -254,6 +273,10 @@ class TestGemSourceGit < Gem::TestCase end end + def test_uri + assert_equal URI(@repository), @source.uri + end + def test_uri_hash assert_equal @hash, @source.uri_hash |