Remote server class that represents NSCA Host.
This commit is contained in:
parent
260e47dc36
commit
6c7814d754
12
lib/nsca/client/remote_server.rb
Normal file
12
lib/nsca/client/remote_server.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
module NSCA
|
||||
module Client
|
||||
class RemoteServer
|
||||
attr_reader :host, :port
|
||||
|
||||
def initialize(options)
|
||||
@host = options[:host]
|
||||
@port = options[:port] || 5667
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
12
spec/nsca/client/remote_server_spec.rb
Normal file
12
spec/nsca/client/remote_server_spec.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe NSCA::Client::RemoteServer do
|
||||
subject { described_class.new(:host => '172.0.0.1') }
|
||||
its(:host) { should eq '172.0.0.1' }
|
||||
its(:port) { should eq 5667 }
|
||||
|
||||
context "custom port" do
|
||||
subject { described_class.new(:port => 12345) }
|
||||
its(:port) { should eq 12345 }
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue