diff options
author | Ben Brown <ben.brown@codethink.co.uk> | 2013-10-24 13:57:01 +0100 |
---|---|---|
committer | Ben Brown <ben.brown@codethink.co.uk> | 2013-10-24 13:57:01 +0100 |
commit | 5b704bb1c1c826891897dee156edb58e2f5c197a (patch) | |
tree | 9ca3801b8fc6c016b08bf7c00fe5b6f957024d9b /yarns/create-deploy.yarn | |
parent | 2fdfa3149be9ae43fb23cda6459e841fb3a90698 (diff) | |
parent | 085e620e5f5d0f85a8012785c89604ffa1a598d4 (diff) | |
download | tbdiff-5b704bb1c1c826891897dee156edb58e2f5c197a.tar.gz |
Merge branch 'benbrown/yarns'
Diffstat (limited to 'yarns/create-deploy.yarn')
-rw-r--r-- | yarns/create-deploy.yarn | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/yarns/create-deploy.yarn b/yarns/create-deploy.yarn new file mode 100644 index 0000000..5a332d7 --- /dev/null +++ b/yarns/create-deploy.yarn @@ -0,0 +1,40 @@ +Trebuchet tests for the creating and deploying of binary deltas +=============================================================== + +The following scenarios test tbdiff-deploy's ability to correctly transform +the content of a target directory, to that of a source directory, given an +appropriate binary delta created by tbdiff-create. + +Simple file diff +---------------- + +This simple test checks that file content is as expected, if the content of +the two text files are different, the test will fail. + + SCENARIO Changing a file's content works + GIVEN a directory exists named 'A' + AND the directory 'A' contains a file named 'foo.txt' with '1' in it + AND a directory exists named 'B' + AND the directory 'B' contains a file named 'foo.txt' with '2' in it + WHEN tbdiff-create creates a binary delta named 'AB.tbdiff' from 'A' to 'B' + AND tbdiff-deploy applies the delta 'AB.tbdiff' to 'A' + THEN the files 'A/foo.txt' and 'B/foo.txt' have the same contents + +Implementations for simple file diff +------------------------------------ + + IMPLEMENTS GIVEN a directory exists named '([^']+)' + mkdir "$DATADIR/$MATCH_1" + + IMPLEMENTS GIVEN the directory '([^']+)' contains a file named '([^']+)' with '([^']+)' in it + echo $MATCH_3 > "$DATADIR/$MATCH_1/$MATCH_2" + + IMPLEMENTS WHEN tbdiff-create creates a binary delta named '([^']+)' from '([^']+)' to '([^']+)' + "$SRCDIR/tbdiff-create/tbdiff-create" "$DATADIR/$MATCH_1" "$DATADIR/$MATCH_2" "$DATADIR/$MATCH_3" + + IMPLEMENTS WHEN tbdiff-deploy applies the delta '([^']+)' to '([^']+)' + cd "$DATADIR/$MATCH_2" + "$SRCDIR/tbdiff-deploy/tbdiff-deploy" "$DATADIR/$MATCH_1" + + IMPLEMENTS THEN the files '([^']+)' and '([^']+)' have the same contents + diff "$DATADIR/$MATCH_1" "$DATADIR/$MATCH_2" |