Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
use test-declare
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Aug 27, 2012
1 parent fbfaec7 commit 6617d1f
Showing 1 changed file with 72 additions and 0 deletions.
72 changes: 72 additions & 0 deletions test/test_parse.rb
@@ -0,0 +1,72 @@
$VERSION = true

require 'test/declare'
require_relative '../lib/networknodemanager/xnmsnmpconf'

sample =<<EOD
#
#
#
192.168.1.100:foo:*:2:3:4::bar:
EOD

The NetworkNodeManager::Xnmsnmpconf.parse(sample).entries do |entries|

The entries.length do
is 1
end

The entries.first do |entry|

The entry.target do
is '192.168.1.100'
end

The entry.get_community do
is 'foo'
end

The entry.proxy do
is '*'
end

The entry.timeout do |timeout|
is_a Time::Unit

The timeout.millisecond do
is 200
end
end

The entry.retry_count do
is 3
end

The entry.status_polling_interval do |interval|
is_a Time::Unit

The interval.second do
is 4
end
end

The entry.remote_port do
is 161
end

The entry.set_community do
is 'bar'
end

The entry.max_by_alert do |mba|
is_a Time::Unit

The mba.second do
is 7
end
end

end

end

0 comments on commit 6617d1f

Please sign in to comment.