From 4f27f3ea59baa6cfca0ac1df96b1dfedbd83706c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 2 Jan 2015 14:00:56 +0100 Subject: initial --- t/post_interactive.t | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 t/post_interactive.t (limited to 't/post_interactive.t') diff --git a/t/post_interactive.t b/t/post_interactive.t new file mode 100644 index 0000000..354d2b5 --- /dev/null +++ b/t/post_interactive.t @@ -0,0 +1,41 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use v5.10; + +use File::Temp qw(tempfile); +use JSON; +use Test::More; + +my $json1 = < '.json' ); +print $jsonfh1 $json1; + +my $json; + +$json = decode_json `./mon --nocolor post host \< $jsonfile1`; +cmp_ok($json->{message}, 'eq', '1 changes successfully commited', 'Testing post'); + +$json = decode_json `./mon --nocolor get host where name like footest.server.lan`; +cmp_ok($json->[0]{address}, 'eq', '127.0.0.1', 'Testing get'); + +$json = decode_json `./mon --nocolor delete host where name like footest.server.lan`; +cmp_ok($json->{message}, 'eq', '1 changes successfully commited', 'Testing delete'); + +unlink $jsonfile1; + +done_testing(); -- cgit v1.2.3