From 92309960338d8628fcc5d08edd2e67d4d0c722cc Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 5 Aug 2013 19:22:03 +0100 Subject: Add test case for multiple records in a single file --- clab.yarn | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'clab.yarn') diff --git a/clab.yarn b/clab.yarn index 2475936..234777c 100644 --- a/clab.yarn +++ b/clab.yarn @@ -41,6 +41,25 @@ sure searches find only the right records. AND Bob is not found AND bob@example.com is not found +Put several records in one file. + + SCENARIO files with multiple records + GIVEN an empty database + AND records for Alice (alice@example.com) and Bob (bob@example.com) + WHEN listing all records + THEN Alice is found + AND Bob is found + + WHEN searching for Alice + THEN Alice is found + AND Bob is not found + + WHEN mutt-querying for Alice + THEN Alice is found + AND alice@example.com is found + AND Bob is not found + AND bob@example.com is not found + Implementation -------------- @@ -55,6 +74,14 @@ These implement the various steps. email: $MATCH_2 EOF + IMPLEMENTS GIVEN records for (\S+) \((\S+)\) and (\S+) \((\S+)\) + cat << EOF > "$DATADIR/db/foo.yaml" + - name: $MATCH_1 + email: $MATCH_2 + - name: $MATCH_3 + email: $MATCH_4 + EOF + IMPLEMENTS WHEN listing all records ./clab --no-default-config --db "$DATADIR/db" list > "$DATADIR/output" -- cgit v1.2.1