This commit is contained in:
Chris Wanstrath 2009-02-13 15:46:59 -08:00
Родитель a683a584c0
Коммит b4e2886c27
1 изменённых файлов: 21 добавлений и 16 удалений

Просмотреть файл

@ -5,50 +5,55 @@ class TestTag < Test::Unit::TestCase
@r = Repo.new(File.join(File.dirname(__FILE__), *%w[dot_git]), :is_bare => true)
end
# list_from_string size
def test_list_from_string_size
assert_equal 5, @r.tags.size
end
# list_from_string
def test_list_from_string
tags = @r.tags
tag = @r.tags[1]
assert_equal 5, tags.size
assert_equal 'not_annotated', tags[1].name
assert_equal 'ca8a30f5a7f0f163bbe3b6f0abf18a6c83b0687a', tags[1].commit.id
assert_equal 'not_annotated', tag.name
assert_equal 'ca8a30f5a7f0f163bbe3b6f0abf18a6c83b0687a', tag.commit.id
end
# list_from_string_for_signed_tag
def test_list_from_string_for_signed_tag
tags = @r.tags
tag = @r.tags[2]
assert_equal 'v0.7.0', tags[2].name
assert_equal '7bcc0ee821cdd133d8a53e8e7173a334fef448aa', tags[2].commit.id
assert_equal 'v0.7.0', tag.name
assert_equal '7bcc0ee821cdd133d8a53e8e7173a334fef448aa', tag.commit.id
end
# list_from_string_for_annotated_tag
def test_list_from_string_for_annotated_tag
tags = @r.tags
tag = @r.tags.first
assert_equal 'annotated', tags.first.name
assert_equal 'ca8a30f5a7f0f163bbe3b6f0abf18a6c83b0687a', tags.first.commit.id
assert_equal 'annotated', tag.name
assert_equal 'ca8a30f5a7f0f163bbe3b6f0abf18a6c83b0687a', tag.commit.id
end
# list_from_string_for_packed_tag
def test_list_from_string_for_packed_tag
tags = @r.tags
tag = @r.tags[4]
assert_equal 'packed', tags[4].name
assert_equal 'ca8a30f5a7f0f163bbe3b6f0abf18a6c83b0687a', tags[4].commit.id
assert_equal 'packed', tag.name
assert_equal 'ca8a30f5a7f0f163bbe3b6f0abf18a6c83b0687a', tag.commit.id
end
# list_from_string_for_packed_annotated_tag
def test_list_from_string_for_packed_annotated_tag
tags = @r.tags
tag = @r.tags[3]
assert_equal 'packed_annotated', tags[3].name
assert_equal '7bcc0ee821cdd133d8a53e8e7173a334fef448aa', tags[3].commit.id
assert_equal 'packed_annotated', tag.name
assert_equal '7bcc0ee821cdd133d8a53e8e7173a334fef448aa', tag.commit.id
end