-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checking an edge case for git strategy
- Loading branch information
1 parent
84ffc6d
commit 215cc46
Showing
3 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'test_helper' | ||
|
||
module ChurnVsComplexity | ||
class GitStrategyIntegrationTest < TLDR | ||
|
||
def test_that_it_can_get_changes_for_the_first_commit | ||
g = GitStrategy.new(folder: ROOT_PATH) | ||
repo = Git.open(ROOT_PATH) | ||
|
||
first_commit = repo.log(max_count = 100_000).last.sha | ||
|
||
changes = g.changes(commit: first_commit) | ||
assert changes.any?, "No changes found for first commit #{first_commit}" | ||
end | ||
|
||
def test_that_it_can_get_changes_for_the_last_commit | ||
g = GitStrategy.new(folder: ROOT_PATH) | ||
repo = Git.open(ROOT_PATH) | ||
|
||
last_commit = repo.log.first.sha | ||
|
||
changes = g.changes(commit: last_commit) | ||
assert changes.any?, "No changes found for last commit #{last_commit}" | ||
end | ||
end | ||
end |