diff --git a/tests/migrate-date-format.expected b/tests/migrate-date-format.expected index 8ba89fa..8648a03 100644 --- a/tests/migrate-date-format.expected +++ b/tests/migrate-date-format.expected @@ -1,17 +1,16 @@ + adr init doc/adr/0001-record-architecture-decisions.md +++ ADR_DATE=12/01/1992 ++ adr new With Old Date Format + adr_file=doc/adr/0002-with-old-date-format.md -+ sed -e 's+^Date: .*$+Date: 12/01/1992+' doc/adr/0002-with-old-date-format.md -+ mv doc/adr/0002-with-old-date-format.md.tmp doc/adr/0002-with-old-date-format.md + adr new With Current Date Format doc/adr/0003-with-current-date-format.md -+ grep 'Date: ' doc/adr/0001-record-architecture-decisions.md doc/adr/0002-with-old-date-format.md doc/adr/0003-with-current-date-format.md ++ grep Date: doc/adr/0001-record-architecture-decisions.md doc/adr/0002-with-old-date-format.md doc/adr/0003-with-current-date-format.md doc/adr/0001-record-architecture-decisions.md:Date: 1992-01-12 doc/adr/0002-with-old-date-format.md:Date: 12/01/1992 doc/adr/0003-with-current-date-format.md:Date: 1992-01-12 + adr upgrade-repository -+ grep 'Date: ' doc/adr/0001-record-architecture-decisions.md doc/adr/0002-with-old-date-format.md doc/adr/0003-with-current-date-format.md ++ grep Date: doc/adr/0001-record-architecture-decisions.md doc/adr/0002-with-old-date-format.md doc/adr/0003-with-current-date-format.md doc/adr/0001-record-architecture-decisions.md:Date: 1992-01-12 doc/adr/0002-with-old-date-format.md:Date: 1992-01-12 doc/adr/0003-with-current-date-format.md:Date: 1992-01-12 diff --git a/tests/migrate-date-format.sh b/tests/migrate-date-format.sh index 18e1ef3..5039f17 100644 --- a/tests/migrate-date-format.sh +++ b/tests/migrate-date-format.sh @@ -1,8 +1,6 @@ adr init -adr_file="`adr new With Old Date Format`" -sed -e 's+^Date: .*$+Date: 12/01/1992+' "$adr_file" > "$adr_file.tmp" -mv "$adr_file.tmp" "$adr_file" +adr_file="$(ADR_DATE=12/01/1992 adr new With Old Date Format)" adr new With Current Date Format -grep 'Date: ' doc/adr/* +grep Date: doc/adr/* adr upgrade-repository -grep 'Date: ' doc/adr/* +grep Date: doc/adr/*