Skip to content

Commit

Permalink
Add tests for default iso8601 timestamps
Browse files Browse the repository at this point in the history
Signed-off-by: Norman Gehrsitz <[email protected]>
  • Loading branch information
ngehrsitz committed Aug 10, 2020
1 parent d3457cf commit 316463e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/get.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

source $(dirname $0)/helpers.sh
source $(dirname $0)/common.sh

it_can_get_from_url() {
local repo=$(init_repo)
Expand Down Expand Up @@ -718,6 +719,23 @@ it_can_get_commit_message() {
( echo "Commit message does not match."; return 1 )
}

it_can_get_commit_timestamp() {
local repo=$(init_repo)
local commit_message='Time-is-relevant!'
local ref=$(make_commit $repo $commit_message)
local dest=$TMPDIR/destination

get_uri $repo $dest $1

pushd $dest
local expected_timestamp=$(git_metadata | jq -r '.[] | select(.name == "committer_date") | .value')
popd

test -e $dest/.git/commit_timestamp || ( echo ".git/commit_timestamp does not exist."; return 1 )
test "$(cat $dest/.git/commit_timestamp)" = "$expected_timestamp" || \
( echo "Commit timestamp differs from expectation."; return 1 )
}

it_decrypts_git_crypted_files() {
local repo=$(git_crypt_fixture_repo_path)
local dest=$TMPDIR/destination
Expand Down Expand Up @@ -831,6 +849,7 @@ run it_can_get_signed_commit_via_tag
run it_can_get_committer_email
run it_can_get_returned_ref
run it_can_get_commit_message
run it_can_get_commit_timestamp
run it_decrypts_git_crypted_files
run it_clears_tags_with_clean_tags_param
run it_retains_tags_by_default
Expand Down

0 comments on commit 316463e

Please sign in to comment.