From 4f27f3ea59baa6cfca0ac1df96b1dfedbd83706c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 2 Jan 2015 14:00:56 +0100 Subject: initial --- t/edit.t | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 t/edit.t (limited to 't/edit.t') diff --git a/t/edit.t b/t/edit.t new file mode 100644 index 0000000..c58bccb --- /dev/null +++ b/t/edit.t @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use v5.10; + +use JSON; +use Test::More; + +chdir '..'; +my $json; +my $ret; + +$json = decode_json `./mon --nocolor insert host set use = generic-host and name = footest.server.lan and host_name = footest.server.lan and address = 127.0.0.1`; +cmp_ok($json->{message}, 'eq', '1 changes successfully commited', 'Testing insert'); + +$ret = `EDITOR=/bin/true ./mon --nocolor edit host where name like footest.server.lan`; +cmp_ok($ret, 'eq', '', 'Testing edit'); + +$ret = `EDITOR=/bin/true ./mon --nocolor edit host where name like footest.server.lan`; +cmp_ok($ret, 'eq', '', 'Testing edit'); + +$json = decode_json `./mon --nocolor delete host where name like footest.server.lan`; +cmp_ok($json->{message}, 'eq', '1 changes successfully commited', 'Testing delete'); + +done_testing(); -- cgit v1.2.3