From 907b03949bab53e2f7d55094100a71abd22f23e7 Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Sun, 11 Nov 2007 16:01:23 -0800 Subject: added tagging --- tests/units/test_tags.rb | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/units/test_tags.rb (limited to 'tests/units/test_tags.rb') diff --git a/tests/units/test_tags.rb b/tests/units/test_tags.rb new file mode 100644 index 0000000..7d6f279 --- /dev/null +++ b/tests/units/test_tags.rb @@ -0,0 +1,35 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../test_helper' + +class TestTags < Test::Unit::TestCase + def setup + set_file_paths + end + + def test_tags + in_temp_dir do |path| + r1 = Git.clone(@wbare, 'repo1') + r2 = Git.clone(@wbare, 'repo2') + + assert_raise Git::GitTagNameDoesNotExist do + r1.tag('first') + end + + r1.add_tag('first') + r1.chdir do + new_file('new_file', 'new content') + end + r1.add + r1.commit('my commit') + r1.add_tag('second') + + assert(r1.tags.map{|t| t.name}.include?('first')) + + r2.add_tag('third') + + assert(r2.tags.map{|t| t.name}.include?('third')) + assert(!r2.tags.map{|t| t.name}.include?('second')) + end + end +end \ No newline at end of file -- cgit