Sha256: f030995fd2c48ac1390741889164c14aa8abdec990a48ae942d7abc8eab7ebd1
Contents?: true
Size: 860 Bytes
Versions: 16
Compression:
Stored size: 860 Bytes
Contents
require 'spec_helper' require 'grocer/failed_delivery_attempt' describe Grocer::FailedDeliveryAttempt do let(:timestamp) { Time.utc(1995, 12, 21) } let(:device_token) { 'fe15a27d5df3c34778defb1f4f3980265cc52c0c047682223be59fb68500a9a2' } let(:binary_tuple) { [timestamp.to_i, 32, device_token].pack('NnH64') } let(:invalid_binary_tuple) { 'totally not the right format' } describe 'decoding' do it 'accepts a binary tuple and sets each attribute' do failed_delivery_attempt = described_class.new(binary_tuple) failed_delivery_attempt.timestamp.should == timestamp failed_delivery_attempt.device_token.should == device_token end it 'raises an exception when there are problems decoding' do -> { described_class.new(invalid_binary_tuple) }.should raise_error(Grocer::InvalidFormatError) end end end
Version data entries
16 entries across 16 versions & 1 rubygems