summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-08 11:22:46 -0800
committerscott Chacon <schacon@agadorsparticus.corp.reactrix.com>2007-11-08 11:22:46 -0800
commitb18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b (patch)
tree718f1b6451f5a9dd9b8cb844fa3d3e9f32400d50 /tests
parent169381bbce998807c119f291d69b8ae1d8fb5785 (diff)
downloadthird_party-ruby-git-b18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b.zip
third_party-ruby-git-b18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b.tar.gz
third_party-ruby-git-b18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b.tar.xz
added log functions
Diffstat (limited to 'tests')
m---------tests/files/working0
-rw-r--r--tests/files/working/ex_dir/ex.txt0
-rw-r--r--tests/files/working/example.txt63
-rw-r--r--tests/units/test_log.rb26
4 files changed, 89 insertions, 0 deletions
diff --git a/tests/files/working b/tests/files/working
deleted file mode 160000
-Subproject 545ffc79786f268524c35e1e05b1770c7c74faf
diff --git a/tests/files/working/ex_dir/ex.txt b/tests/files/working/ex_dir/ex.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/files/working/ex_dir/ex.txt
diff --git a/tests/files/working/example.txt b/tests/files/working/example.txt
new file mode 100644
index 0000000..8a3fb74
--- /dev/null
+++ b/tests/files/working/example.txt
@@ -0,0 +1,63 @@
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
+1
diff --git a/tests/units/test_log.rb b/tests/units/test_log.rb
new file mode 100644
index 0000000..4dd6a2f
--- /dev/null
+++ b/tests/units/test_log.rb
@@ -0,0 +1,26 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../test_helper'
+
+class TestInit < Test::Unit::TestCase
+ def setup
+ set_file_paths
+ @git = Git.open(@wdir)
+ end
+
+ def test_get_log_entries
+ log = @git.log
+ assert(log.first.is_a? Git::Commit)
+ end
+
+ def test_get_log_entries
+ assert_equal(30, @git.log.size)
+ assert_equal(50, @git.log(50).size)
+ assert_equal(10, @git.log(10).size)
+ end
+
+ def test_get_log_to_s
+ assert_equal(@git.log.to_s.split("\n").first, @git.log.first.sha)
+ end
+
+end