Permalink
Browse files

connect to readonly by default

  • Loading branch information...
1 parent 6a70dca commit 1c07506db2bb7271d6ed7df46c7f42c308306beb @igrigorik committed Jan 10, 2011
Showing with 15 additions and 1 deletion.
  1. +6 −1 lib/em-handlersocket.rb
  2. +9 −0 spec/client_spec.rb
View
@@ -3,7 +3,12 @@
module EventMachine
module HandlerSocket
- def self.new(opt = {})
+ def self.new(options = {})
+ opt = {
+ :host => '127.0.0.1',
+ :port => '9998'
+ }.merge(options)
+
EventMachine.connect(opt[:host], opt[:port], EventMachine::HandlerSocket::Client)
end
end
View
@@ -11,4 +11,13 @@
}
end
+ it "should connect to localhost, read-only port by default" do
+ EM.run {
+ c = EM::HandlerSocket.new
+ c.class.should == EventMachine::HandlerSocket::Client
+
+ EM.stop
+ }
+ end
+
end

0 comments on commit 1c07506

Please sign in to comment.