@@ -7,13 +7,13 @@ def setup
7
7
set_file_paths
8
8
@git = Git . open ( @wdir )
9
9
10
- @commit = @git . object ( '1cc8667014381' )
11
- @tree = @git . object ( '1cc8667014381^{tree}' )
12
- @blob = @git . object ( 'v2.5:example.txt' )
10
+ @commit = @git . gcommit ( '1cc8667014381' )
11
+ @tree = @git . gtree ( '1cc8667014381^{tree}' )
12
+ @blob = @git . gblob ( 'v2.5:example.txt' )
13
13
end
14
14
15
15
def test_commit
16
- o = @git . object ( '1cc8667014381' )
16
+ o = @git . gcommit ( '1cc8667014381' )
17
17
assert ( o . is_a? ( Git ::Object ::Commit ) )
18
18
assert ( o . commit? )
19
19
assert ( !o . tag? )
@@ -34,17 +34,17 @@ def test_commit
34
34
assert_equal ( 'master' , o . parent . parent . name )
35
35
assert_equal ( 'master~1' , o . parent . parent . parent . name )
36
36
37
- o = @git . object ( 'HEAD' )
37
+ o = @git . gcommit ( 'HEAD' )
38
38
assert ( o . is_a? ( Git ::Object ::Commit ) )
39
39
assert_equal ( 'commit' , o . type )
40
40
41
- o = @git . object ( 'test_object' )
41
+ o = @git . gcommit ( 'test_object' )
42
42
assert ( o . is_a? ( Git ::Object ::Commit ) )
43
43
assert_equal ( 'commit' , o . type )
44
44
end
45
45
46
46
def test_commit_contents
47
- o = @git . object ( '1cc8667014381' )
47
+ o = @git . gcommit ( '1cc8667014381' )
48
48
assert_equal ( 'tree 94c827875e2cadb8bc8d4cdd900f19aa9e8634c7' , o . contents_array [ 0 ] )
49
49
assert_equal ( 'parent 546bec6f8872efa41d5d97a369f669165ecda0de' , o . contents_array [ 1 ] )
50
50
end
@@ -62,39 +62,39 @@ def test_object_size
62
62
end
63
63
64
64
def test_tree
65
- o = @git . object ( '1cc8667014381^{tree}' )
65
+ o = @git . gtree ( '1cc8667014381^{tree}' )
66
66
assert ( o . is_a? ( Git ::Object ::Tree ) )
67
67
assert ( o . tree? )
68
68
69
- o = @git . object ( 'v2.7^{tree}' )
69
+ o = @git . gtree ( 'v2.7^{tree}' )
70
70
71
71
assert_equal ( 2 , o . children . size )
72
72
assert_equal ( 1 , o . blobs . size )
73
73
assert_equal ( 1 , o . subtrees . size )
74
74
assert_equal ( 1 , o . trees [ 'ex_dir' ] . blobs . size )
75
75
76
- o = @git . object ( '94c827875e2cadb8bc8d4cdd900f19aa9e8634c7' )
76
+ o = @git . gtree ( '94c827875e2cadb8bc8d4cdd900f19aa9e8634c7' )
77
77
assert ( o . is_a? ( Git ::Object ::Tree ) )
78
78
assert_equal ( 'tree' , o . type )
79
79
end
80
80
81
81
def test_tree_contents
82
- o = @git . object ( '1cc8667014381^{tree}' )
82
+ o = @git . gtree ( '1cc8667014381^{tree}' )
83
83
assert_equal ( '040000 tree 6b790ddc5eab30f18cabdd0513e8f8dac0d2d3ed ex_dir' , o . contents_array . first )
84
84
end
85
85
86
86
def test_blob
87
- o = @git . object ( 'ba492c62b6' )
87
+ o = @git . gblob ( 'ba492c62b6' )
88
88
assert ( o . is_a? ( Git ::Object ::Blob ) )
89
89
assert ( o . blob? )
90
90
91
- o = @git . object ( 'v2.5:example.txt' )
91
+ o = @git . gblob ( 'v2.5:example.txt' )
92
92
assert ( o . is_a? ( Git ::Object ::Blob ) )
93
93
assert_equal ( 'blob' , o . type )
94
94
end
95
95
96
96
def test_blob_contents
97
- o = @git . object ( 'v2.6:example.txt' )
97
+ o = @git . gblob ( 'v2.6:example.txt' )
98
98
assert_equal ( 'replace with new text' , o . contents )
99
99
assert_equal ( 'replace with new text' , o . contents ) # this should be cached
100
100
end
0 commit comments