Permalink
Browse files

Added a client spec

  • Loading branch information...
1 parent 9891c55 commit 608d6c8a06238b21ee3111932cfe4b8bc8083318 @seejohnrun committed Apr 25, 2012
Showing with 23 additions and 4 deletions.
  1. +1 −1 lib/apns.rb
  2. +3 −3 lib/apns/connector.rb
  3. +19 −0 spec/apns/client_spec.rb
View
@@ -4,7 +4,7 @@
module APNS
# We are a connector
- include Connector
+ extend Connector
# And we have a class Client, which is also a connector
class Client
View
@@ -7,9 +7,9 @@ module Connector
attr_accessor :host, :pem, :port, :pass
- def initialize(host = GATEWAY_HOST, port = 2195, pem = nil, pass = nil)
- @host = host
- @port = port
+ def initialize(host = nil, port = nil, pem = nil, pass = nil)
+ @host = host || 'gateway.sandbox.push.apple.com'
+ @port = port || 2195
@pem = pem
@pass = pass
end
View
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe APNS::Client do
+
+ context 'when changing fields' do
+
+ let(:client) { APNS::Client.new }
+
+ before do
+ client.port = 6400
+ end
+
+ it 'should have a different port' do
+ client.port.should_not == APNS.port
+ end
+
+ end
+
+end

0 comments on commit 608d6c8

Please sign in to comment.