Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added a client spec

  • Loading branch information...
commit 608d6c8a06238b21ee3111932cfe4b8bc8083318 1 parent 9891c55
John Crepezzi authored April 25, 2012
2  lib/apns.rb
@@ -4,7 +4,7 @@
4 4
 module APNS
5 5
 
6 6
   # We are a connector
7  
-  include Connector
  7
+  extend Connector
8 8
 
9 9
   # And we have a class Client, which is also a connector
10 10
   class Client
6  lib/apns/connector.rb
@@ -7,9 +7,9 @@ module Connector
7 7
 
8 8
     attr_accessor :host, :pem, :port, :pass
9 9
 
10  
-    def initialize(host = GATEWAY_HOST, port = 2195, pem = nil, pass = nil)
11  
-      @host = host
12  
-      @port = port
  10
+    def initialize(host = nil, port = nil, pem = nil, pass = nil)
  11
+      @host = host || 'gateway.sandbox.push.apple.com'
  12
+      @port = port || 2195
13 13
       @pem = pem
14 14
       @pass = pass
15 15
     end
19  spec/apns/client_spec.rb
... ...
@@ -0,0 +1,19 @@
  1
+require 'spec_helper'
  2
+
  3
+describe APNS::Client do
  4
+
  5
+  context 'when changing fields' do
  6
+
  7
+    let(:client) { APNS::Client.new }
  8
+
  9
+    before do
  10
+      client.port = 6400
  11
+    end
  12
+
  13
+    it 'should have a different port' do
  14
+      client.port.should_not == APNS.port
  15
+    end
  16
+
  17
+  end
  18
+
  19
+end

0 notes on commit 608d6c8

Please sign in to comment.
Something went wrong with that request. Please try again.