Sha256: c67b5b8394c15b05748af23977cafb9554c066e7bd8210b8e4cbd74dfdd8e3ff

Contents?: true

Size: 717 Bytes

Versions: 3

Compression:

Stored size: 717 Bytes

Contents

#!/bin/bash

#
# Unit test for twmail-hook
#

# Data locations
DIRNAME=$(cd $(dirname $0);pwd)
DATA_DIR=$(mktemp -dt $(basename $0))
export TASKRC=$(mktemp -t taskrc)

source $DIRNAME/../helpers/assertions

# Create custom taskrc
cat > $TASKRC <<HERE
data.location=$DATA_DIR
json.array=on
verbose=off
HERE

# Canonical path to test_hook
export twmail-hook=$DIRNAME/../helpers/test_hook

# Create new task using mail fixture
cat $DIRNAME/../fixtures/mail01.txt | $DIRNAME/../../bin/twmail-hook

# Read back and run assertions
SUBJECT=$(task export | ruby -r json -e "puts JSON[ARGF.read].first['description']")

assert_equal "Send some test mails" "$SUBJECT"

# Clean up
rm -Rf $DATA_DIR
rm -Rf $TASKRC
export TASKRC=

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twmail-1.0.0 test/unit/test_twmail_hooks
twmail-0.0.6 test/unit/test_twmail_hooks
twmail-0.0.5 test/unit/test_twmail_hooks