summaryrefslogtreecommitdiff
path: root/t/get_interactive.t
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2015-01-02 14:00:56 +0100
committerPaul Buetow <paul@buetow.org>2015-01-02 14:00:56 +0100
commit4f27f3ea59baa6cfca0ac1df96b1dfedbd83706c (patch)
tree79754e3c49216f80cb3ad5579851fca0bf1a31c9 /t/get_interactive.t
initial
Diffstat (limited to 't/get_interactive.t')
-rw-r--r--t/get_interactive.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/get_interactive.t b/t/get_interactive.t
new file mode 100644
index 0000000..85ae878
--- /dev/null
+++ b/t/get_interactive.t
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use v5.10;
+
+use JSON;
+use Test::More;
+
+chdir '..';
+my $json;
+
+$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');
+
+$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 get host`;
+cmp_ok(scalar @$json, '>', '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');
+
+done_testing();