[NEW] Initial Revision
[obnox/ohloh/ohloh_scm.git] / test / unit / git_misc_test.rb
1 require File.dirname(__FILE__) + '/../test_helper'
2
3 module Scm::Adapters
4         class GitMiscTest < Scm::Test
5
6                 def test_export
7                         with_git_repository('git') do |git|
8                                 Scm::ScratchDir.new do |dir|
9                                         git.export(dir)
10                                         assert_equal ['.','..','.gitignore','COPYING','README','helloworld.c','makefile','ohloh_token'], Dir.entries(dir).sort
11                                 end
12                         end
13                 end
14
15                 def test_head
16                         with_git_repository('git') do |git|
17                                 assert git.exist?
18                                 assert_equal '1df547800dcd168e589bb9b26b4039bff3a7f7e4', git.head
19                                 assert_equal ['master'], git.branches
20                                 assert git.has_branch?('master')
21                         end
22                 end
23
24         end
25 end