From b18bca3b853dee6a7bc86f09921aa3b1ee3f3d7b Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Thu, 8 Nov 2007 11:22:46 -0800 Subject: added log functions --- tests/units/test_log.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/units/test_log.rb (limited to 'tests/units') 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 -- cgit