summaryrefslogtreecommitdiffstats
path: root/tests/units
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/units
parent169381bbce998807c119f291d69b8ae1d8fb5785 (diff)
downloadthird_party-ruby-git-b18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b.tar.gz
third_party-ruby-git-b18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b.tar.xz
third_party-ruby-git-b18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b.zip
added log functions
Diffstat (limited to 'tests/units')
-rw-r--r--tests/units/test_log.rb26
1 files changed, 26 insertions, 0 deletions
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