summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.(none)>2007-11-11 11:03:03 -0800
committerscott Chacon <schacon@agadorsparticus.(none)>2007-11-11 11:03:03 -0800
commit440ec51cded64d49c5c2aae949401dd60e4b876d (patch)
tree2c5ea51e59e724203e7aceeed7d15d7b71d36690 /tests
parenta4fa110279ea28873fe1e4df10c89ddc591046b4 (diff)
downloadthird_party-ruby-git-440ec51cded64d49c5c2aae949401dd60e4b876d.zip
third_party-ruby-git-440ec51cded64d49c5c2aae949401dd60e4b876d.tar.gz
third_party-ruby-git-440ec51cded64d49c5c2aae949401dd60e4b876d.tar.xz
fixed a small environment bug
Diffstat (limited to 'tests')
-rw-r--r--tests/units/test_config.rb2
-rw-r--r--tests/units/test_index.rb77
2 files changed, 1 insertions, 78 deletions
diff --git a/tests/units/test_config.rb b/tests/units/test_config.rb
index 66dc9ff..46ccd1e 100644
--- a/tests/units/test_config.rb
+++ b/tests/units/test_config.rb
@@ -2,7 +2,7 @@
require File.dirname(__FILE__) + '/../test_helper'
-class TestBranch < Test::Unit::TestCase
+class TestConfig < Test::Unit::TestCase
def setup
set_file_paths
@git = Git.open(@wdir)
diff --git a/tests/units/test_index.rb b/tests/units/test_index.rb
deleted file mode 100644
index b4e2f81..0000000
--- a/tests/units/test_index.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.dirname(__FILE__) + '/../test_helper'
-
-class TestIndex< Test::Unit::TestCase
-
- def setup
- set_file_paths
- @git = Git.open(@wdir)
- end
-
- def test_add
- in_temp_dir do |path|
- g = Git.clone(@wbare, 'new')
- Dir.chdir('new') do
- puts `pwd`
- #assert_equal('100644', g.status['example.txt'].mode_index)
-
- new_file('test-file', 'blahblahblah')
- assert(g.status.untracked.assoc('test-file'))
-
- g.add
- assert(g.status.added.assoc('test-file'))
- assert(!g.status.untracked.assoc('test-file'))
- assert(!g.status.changed.assoc('example.txt'))
-
- append_file('example.txt', 'hahahaha')
- puts g.status.pretty
- assert(g.status.changed.assoc('example.txt'))
-
- g.add
- assert(g.status.changed.assoc('example.txt'))
-
- g.commit('my message')
- assert(!g.status.changed.assoc('example.txt'))
- assert(!g.status.added.assoc('test-file'))
- assert(!g.status.untracked.assoc('test-file'))
- assert_equal('hahahaha', g.status['example.txt'].blob.contents)
- end
- end
- end
-
- def test_add_array
- in_temp_dir do |path|
- g = Git.clone(@wbare, 'new')
- Dir.chdir('new') do
-
- new_file('test-file1', 'blahblahblah1')
- new_file('test-file2', 'blahblahblah2')
- assert(g.status.untracked.assoc('test-file1'))
-
- g.add(['test-file1', 'test-file2'])
- assert(g.status.added.assoc('test-file1'))
- assert(g.status.added.assoc('test-file1'))
- assert(!g.status.untracked.assoc('test-file1'))
-
- g.commit('my message')
- assert(!g.status.added.assoc('test-file1'))
- assert(!g.status.untracked.assoc('test-file1'))
- assert_equal('blahblahblah1', g.status['test-file1'].blob.contents)
- end
- end
- end
-
- def new_file(name, contents)
- File.open(name, 'w') do |f|
- f.puts contents
- end
- end
-
- def append_file(name, contents)
- File.open(name, 'a') do |f|
- f.puts contents
- end
- end
-
-end \ No newline at end of file