1
0
Fork 0
mirror of synced 2024-11-22 16:25:34 -05:00
dotbot/test/tests/plugin.bash
2016-02-06 15:23:39 -05:00

28 lines
544 B
Bash

test_description='plugin loading works'
. '../test-lib.bash'
test_expect_success 'setup' '
cat > ${DOTFILES}/test.py <<EOF
import dotbot
import os.path
class Test(dotbot.Plugin):
def can_handle(self, directive):
return directive == "test"
def handle(self, directive, data):
with open(os.path.expanduser("~/flag"), "w") as f:
f.write("it works")
return True
EOF
'
test_expect_success 'run' '
run_dotbot --plugin test.py <<EOF
- test: ~
EOF
'
test_expect_success 'test' '
grep "it works" ~/flag
'