Feature: Checksum Scenario: Checksum classic Given I clear tmp And the following files exists: | path | content | | src/file1.txt | file 1 | | src/file2.txt | file 2 | | src/file3.txt | file 3 | | src/file4.txt | file 4 | | dst/4/3/4/9/4349cfeff8e2eb74dffc369bb5fd084e | old content | And the directory "dst" exists When I call "checksummer tmp/src tmp/dst" Then I should see 4 files in "tmp/dst" Then I should see the following files | symlink | path | content | | src/file1.txt | dst/e/2/4/3/e243bb39c844b3543a7726576c869caf | file 1 | | src/file2.txt | dst/4/3/4/9/4349cfeff8e2eb74dffc369bb5fd084e | old content | | src/file3.txt | dst/9/c/3/8/9c38e8324dbf031557c89d53a39f0b26 | file 3 | | src/file4.txt | dst/f/b/8/b/fb8b37442ead70d36d54d241a0c7e069 | file 4 | Scenario: Checksum classic with find options Given I clear tmp And the following files exists: | path | content | | src/file10.txt | file 10 | | src/file11.txt | file 11 | | src/file20.txt | file 20 | | src/file21.txt | file 21 | And the directory "dst" exists When I call "checksummer tmp/src tmp/dst -name 'file1*'" Then I should see 2 files in "tmp/dst" Then I should see the following files | symlink | path | content | | src/file10.txt | dst/a/9/e/3/a9e3737bb4cf960ff521c4ad4c8275e7 | file 10 | | src/file11.txt | dst/7/1/5/0/715081268e5e053a7e89daf6c155244a | file 11 | And the output should look like this | index | total | checksummed_path | | 1 | 2 | tmp/dst/a/9/e/3/a9e3737bb4cf960ff521c4ad4c8275e7 | | 2 | 2 | tmp/dst/7/1/5/0/715081268e5e053a7e89daf6c155244a | Scenario: Checksum from stdin Given I clear tmp And the following files exists: | path | content | | src/file10.txt | file 10 | | src/file11.txt | file 11 | | src/file20.txt | file 20 | | src/file21.txt | file 21 | And the directory "dst" exists When I call "checksummer --stdin tmp/dst" piped through "find tmp/src -name 'file1*.txt' -printf '%p\t%s\n'" Then I should see 2 files in "tmp/dst" Then I should see the following files | symlink | path | content | | src/file10.txt | dst/a/9/e/3/a9e3737bb4cf960ff521c4ad4c8275e7 | file 10 | | src/file11.txt | dst/7/1/5/0/715081268e5e053a7e89daf6c155244a | file 11 | And the output should look like this | index | total | checksummed_path | | 1 | 2 | tmp/dst/a/9/e/3/a9e3737bb4cf960ff521c4ad4c8275e7 | | 2 | 2 | tmp/dst/7/1/5/0/715081268e5e053a7e89daf6c155244a | Scenario: Checksum from plain text Given I clear tmp And the following files exists: | path | content | | src/file10.txt | file 10 | | src/file11.txt | file 11 | | src/file20.txt | file 20 | | src/file21.txt | file 21 | And the following file list exists in "src/files.txt" | path | | src/file10.txt | | src/file20.txt | | src/file30.txt | And the directory "dst" exists When I call "checksummer --stdin tmp/dst" piped through "cat tmp/src/files.txt" Then I should see 2 files in "tmp/dst" Then I should see the following files | symlink | path | content | | src/file10.txt | dst/a/9/e/3/a9e3737bb4cf960ff521c4ad4c8275e7 | file 10 | | src/file20.txt | dst/0/6/7/f/067f81212cf0fb2e982bd628a8606f97 | file 20 | Scenario: Checksum single files Given I clear tmp And the following files exists: | path | content | | src/file10.txt | file 10 | | src/file11.txt | file 11 | | src/file20.txt | file 20 | | src/file21.txt | file 21 | And the directory "dst" exists When I call "checksummer tmp/src/file11.txt tmp/dst" Then I should see 1 files in "tmp/dst" Then I should see the following files | symlink | path | content | | src/file11.txt | dst/7/1/5/0/715081268e5e053a7e89daf6c155244a | file 11 | Scenario: Checksum not existing file Given I clear tmp And the directory "dst" exists When I call "checksummer tmp/src/file11.txt tmp/dst" Then I should get the following response | status | not_found | | original_line | tmp/src/file11.txt |