summaryrefslogtreecommitdiffstats
path: root/tests/units/test_log.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tests/units/test_log.rb')
-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