We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59022ce commit 889194cCopy full SHA for 889194c
test/integration_test.rb
@@ -4,9 +4,16 @@
4
5
class IntegrationTest < Minitest::Test
6
def test_that_main_interface_returns_non_empty_result_for_valid_input
7
- changes = FilesInMyDiff.checkout(folder: GIT_PROJECT_PATH, revision: 'HEAD')
+ result = FilesInMyDiff.checkout(folder: GIT_PROJECT_PATH, revision: 'HEAD')
8
+ result => { dir:, sha:, changes: }
9
- refute_nil changes
10
- refute_empty changes
+ 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}"
18
end
19
0 commit comments