Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Start spec file for github issues. Add issue #3.
Browse files Browse the repository at this point in the history
  • Loading branch information
bernd committed Oct 22, 2011
1 parent 6873e41 commit 6d80545
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/github_issues_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
require 'spec_helper'
require 'nagios_parser/object/parser'

describe "Github issues" do
describe "#3" do
it "can parse the user provided object config" do
object = <<-__OBJ
define host{
use switch
host_name Foo-ibb
alias Foo iBootBar
address 10.3.1.20
hostgroups iboots,Foo
parents Foo-modem
}
__OBJ

out = NagiosParser::Object::Parser.parse(object)
host = out['host'].first
host['use'].should == 'switch'
host['host_name'].should == 'Foo-ibb'
host['alias'].should == 'Foo iBootBar'
host['address'].should == '10.3.1.20'
host['hostgroups'].should == 'iboots,Foo'
host['parents'].should == 'Foo-modem'
end
end
end

0 comments on commit 6d80545

Please sign in to comment.