fixed a small environment bug
[rubygit.git] / tests / units / test_config.rb
blob46ccd1e25c53dae9dec8de7819ba9100807d58e4
1 #!/usr/bin/env ruby
3 require File.dirname(__FILE__) + '/../test_helper'
5 class TestConfig < Test::Unit::TestCase
6   def setup
7     set_file_paths
8     @git = Git.open(@wdir)
9   end
10   
11   def test_config
12     c = @git.config
13     assert_equal('scott Chacon', c['user.name'])
14     assert_equal('false', c['core.bare'])
15   end
16   
17   def test_read_config
18     assert_equal('scott Chacon', @git.config('user.name'))
19     assert_equal('false', @git.config('core.bare'))
20   end
21   
22   def test_set_config
23     in_temp_dir do |path|
24       g = Git.clone(@wbare, 'bare')
25       assert_equal('scott Chacon', g.config('user.name'))
26       g.config('user.name', 'bully')
27       assert_equal('bully', g.config('user.name'))
28     end
29   end  
30   
31 end