From 839cf4429a69a56fd4cc5aaac069d20915e76597 Mon Sep 17 00:00:00 2001 From: Ivan Povalyukhin Date: Sun, 29 Mar 2015 16:31:05 -0700 Subject: [PATCH] start with tests for base.plugin --- test/plugins/base.plugin.bats | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 test/plugins/base.plugin.bats diff --git a/test/plugins/base.plugin.bats b/test/plugins/base.plugin.bats new file mode 100755 index 00000000..fe936e60 --- /dev/null +++ b/test/plugins/base.plugin.bats @@ -0,0 +1,19 @@ +#!/usr/bin/env bats + +load ../test_helper +load ../../lib/composure +load ../../plugins/available/base.plugin + +@test 'plugins base: ips()' { + declare -r localhost='127.0.0.1' + run ips + assert_success + assert_line $localhost +} + +@test 'plugins base: myip()' { + run myip + assert_success + declare -r mask_ip=$(echo $output | tr -s '[0-9]' '?') + [[ $mask_ip == 'Your public IP is: ?.?.?.?' ]] +}