Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8938

Show
Ignore:
Timestamp:
02/28/08 03:38:15 (7 months ago)
Author:
minam
Message:

Fix git SCM module unit tests (closes #11221)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/capistrano/test/deploy/scm/git_test.rb

    r8923 r8938  
    1616  def test_head 
    1717    assert_equal "HEAD", @source.head 
     18     
     19    # With :branch 
    1820    @config[:branch] = "master" 
    1921    assert_equal "master", @source.head 
    2022  end 
    2123 
    22   def origin 
    23     asser_equal "origin", @source.origin 
    24     @config[:remote] = "git
    25     assert_equal "git", @source.origin 
     24  def test_origin 
     25    assert_equal "origin", @source.origin 
     26    @config[:remote] = "username
     27    assert_equal "username", @source.origin 
    2628  end 
    2729 
     
    3234    assert_equal "git clone git@somehost.com:project.git /var/www && cd /var/www && git checkout -b deploy #{rev}", @source.checkout(rev, dest) 
    3335 
    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) 
    3740  end 
    3841 
     
    6265    assert_equal "cd #{dest} && git fetch origin && git reset --hard #{rev}", @source.sync(rev, dest) 
    6366 
    64     # With branch 
    65     @config[:branch] = "foo" 
    66     rev = '92d9e79' # simulate rev change 
    67     assert_equal "cd #{dest} && git fetch origin && git reset --hard #{rev}", @source.sync(rev, dest) 
    68  
    6967    # With :scm_command 
    7068    git = "/opt/local/bin/git" 
     
    9189    rev = 'c2d9e79' 
    9290    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 branch 
    95     @config[:branch] = "origin/foo" 
    96     rev = '92d9e79' # simulate rev change 
    97     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) 
    9891  end 
    9992 
     
    10396    dest = "/var/www" 
    10497    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 branch 
    108     @config[:branch] = "foo" 
    10998    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) 
    11099  end