Changeset 8938
- Timestamp:
- 02/28/08 03:38:15 (7 months ago)
- Files:
-
- tools/capistrano/test/deploy/scm/git_test.rb (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/capistrano/test/deploy/scm/git_test.rb
r8923 r8938 16 16 def test_head 17 17 assert_equal "HEAD", @source.head 18 19 # With :branch 18 20 @config[:branch] = "master" 19 21 assert_equal "master", @source.head 20 22 end 21 23 22 def origin23 asser _equal "origin", @source.origin24 @config[:remote] = " git"25 assert_equal " git", @source.origin24 def test_origin 25 assert_equal "origin", @source.origin 26 @config[:remote] = "username" 27 assert_equal "username", @source.origin 26 28 end 27 29 … … 32 34 assert_equal "git clone git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deploy #{rev}", @source.checkout(rev, dest) 33 35 34 # With branch 35 @config[:branch] = "origin/foo" 36 assert_equal "git clone git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deploy #{rev}", @source.checkout(rev, dest) 36 # With :scm_command 37 git = "/opt/local/bin/git" 38 @config[:scm_command] = git 39 assert_equal "#{git} clone git@somehost.com:project.git /var/www && cd /var/www && #{git} checkout -b deploy #{rev}", @source.checkout(rev, dest) 37 40 end 38 41 … … 62 65 assert_equal "cd #{dest} && git fetch origin && git reset --hard #{rev}", @source.sync(rev, dest) 63 66 64 # With branch65 @config[:branch] = "foo"66 rev = '92d9e79' # simulate rev change67 assert_equal "cd #{dest} && git fetch origin && git reset --hard #{rev}", @source.sync(rev, dest)68 69 67 # With :scm_command 70 68 git = "/opt/local/bin/git" … … 91 89 rev = 'c2d9e79' 92 90 assert_equal "git clone --depth 1 git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deploy #{rev}", @source.checkout(rev, dest) 93 94 # With branch95 @config[:branch] = "origin/foo"96 rev = '92d9e79' # simulate rev change97 assert_equal "git clone --depth 1 git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deploy #{rev}", @source.checkout(rev, dest)98 91 end 99 92 … … 103 96 dest = "/var/www" 104 97 rev = 'c2d9e79' 105 assert_equal "git clone -o username git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deploy #{rev}", @source.checkout(rev, dest)106 107 # With branch108 @config[:branch] = "foo"109 98 assert_equal "git clone -o username git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deploy #{rev}", @source.checkout(rev, dest) 110 99 end