Skip to content

Commit 889194c

Browse files
committed
More thorough integration test
1 parent 59022ce commit 889194c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/integration_test.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@
44

55
class IntegrationTest < Minitest::Test
66
def test_that_main_interface_returns_non_empty_result_for_valid_input
7-
changes = FilesInMyDiff.checkout(folder: GIT_PROJECT_PATH, revision: 'HEAD')
7+
result = FilesInMyDiff.checkout(folder: GIT_PROJECT_PATH, revision: 'HEAD')
8+
result => { dir:, sha:, changes: }
89

9-
refute_nil changes
10-
refute_empty changes
10+
refute_nil dir
11+
refute_nil sha
12+
has_correct_changes = changes&.any? && changes.all? do |change|
13+
fp = change[:full_path]
14+
!fp.nil? && !fp.empty? && fp.start_with?(dir) && fp.include?(sha)
15+
end
16+
17+
assert has_correct_changes, "Changes are not valid: #{changes.inspect}"
1118
end
1219
end

0 commit comments

Comments
 (0)