Permalink
Browse files

Default port to statsd's default port, 8125

  • Loading branch information...
1 parent 3f9d9c3 commit 7c73c8d8448f721fcf8306b961304f40162b502e @reinh committed Feb 20, 2011
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/statsd.rb
  2. +4 −0 spec/statsd_spec.rb
View
2 lib/statsd.rb
@@ -11,7 +11,7 @@
class Statsd
# @param [String] host your statsd host
# @param [Integer] port your statsd port
- def initialize(host, port)
+ def initialize(host, port=8125)
@host, @port = host, port
end
View
4 spec/statsd_spec.rb
@@ -17,6 +17,10 @@ def socket; @socket ||= FakeUDPSocket.new end
@statsd.host.must_equal 'localhost'
@statsd.port.must_equal 1234
end
+
+ it "should default the port to 8125" do
+ Statsd.new('localhost').instance_variable_get('@port').must_equal 8125
+ end
end

0 comments on commit 7c73c8d

Please sign in to comment.