Skip to content

Commit 81e80b0

Browse files
hotchpotchschacon
authored andcommitted
add test for these commits.
- ecc0ce5 - 499758f Signed-off-by: Scott Chacon <schacon@gmail.com>
1 parent 4965154 commit 81e80b0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

tests/units/test_diff.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ def test_diff_tags
2424

2525
def test_diff_path
2626
d = @git.diff('gitsearch1', 'v2.5').path('scott/')
27+
assert_equal(d.from, 'gitsearch1')
28+
assert_equal(d.to, 'v2.5')
2729
assert_equal(2, d.size)
2830
assert_equal(9, d.lines)
2931
assert_equal(9, d.deletions)
@@ -83,4 +85,4 @@ def test_diff_each
8385
end
8486

8587

86-
end
88+
end

tests/units/test_log.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ def test_get_log_entries
2323
def test_get_log_to_s
2424
assert_equal(@git.log.to_s.split("\n").first, @git.log.first.sha)
2525
end
26+
27+
def test_log_skip
28+
three1 = @git.log(3).to_a[-1]
29+
three2 = @git.log(2).skip(1).to_a[-1]
30+
three3 = @git.log(1).skip(2).to_a[-1]
31+
assert_equal(three2.sha, three3.sha)
32+
assert_equal(three1.sha, three2.sha)
33+
end
2634

2735
def test_get_log_since
2836
l = @git.log.since("2 seconds ago")

tests/units/test_object.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,4 @@ def test_grep
135135
end
136136

137137

138-
end
138+
end

0 commit comments

Comments
 (0)