git » nmdb » commit 4e157bb

Add a small Ruby test.

author Alberto Bertogli
2007-09-02 01:02:50 UTC
committer Alberto Bertogli
2007-09-02 01:02:50 UTC
parent 49258830bf3d0d275928fa98f93525a5b5b7afb8

Add a small Ruby test.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>

bindings/ruby/test1.rb +18 -0

diff --git a/bindings/ruby/test1.rb b/bindings/ruby/test1.rb
new file mode 100644
index 0000000..b5a0641
--- /dev/null
+++ b/bindings/ruby/test1.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+require 'nmdb'
+
+db = Nmdb::DB.new
+db.add_tipc_server()
+db.add_udp_server('localhost')
+db.add_tcp_server('localhost')
+db.add_sctp_server('localhost')
+
+puts 'set 1 <- 2'; db[1] = 2
+puts 'get 1: ' + db[1].to_s
+
+db.automarshal = false
+puts 'set I <- 10\0'; db['I'] = "10\0"
+puts 'incr I 10: ' + db.incr('I', 10).to_s
+puts 'get I: ' + db['I'].to_s
+