Sha256: 83666167c913f07719e82930e12700fdff8f6ed66ea73ff6187b774a4b1d2299

Contents?: true

Size: 488 Bytes

Versions: 2

Compression:

Stored size: 488 Bytes

Contents

require 'spec_helper'

describe "TestProtocol" do
  before(:each) do
    @server = TestServer.new
    @server.queue = Array.new # fake out EM::Queue
  end

  it "adds_notification_to_queue" do
    token = "12345678123456781234567812345678"
    @server.receive_data("\0\0 #{token}\0#{22.chr}{\"aps\":{\"alert\":\"Hi\"}}")
    @server.queue.size.should == 1
  end

  it "does_not_add_invalid_notification" do
    @server.receive_data('fakedata')
    @server.queue.should be_empty
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
apnserver-0.2.2 spec/models/protocol_spec.rb
apnserver-0.2.1 spec/models/protocol_spec.rb