Skip to content
Browse files

Fixing broken spec for logging

  • Loading branch information...
1 parent b980310 commit 265a5f2aa0f8e741b4f7eec378a79fd69e5a9ac9 @mattconnolly committed Sep 10, 2012
Showing with 6 additions and 3 deletions.
  1. +5 −2 lib/rapns/daemon/feedback_receiver.rb
  2. +1 −1 spec/rapns/daemon/feedback_receiver_spec.rb
View
7 lib/rapns/daemon/feedback_receiver.rb
@@ -25,8 +25,8 @@ def start
# and retrying later might make sense (for example, a network outage)
@stop = true
break
- rescue StandardError => e
- Rapns::Daemon.logger.error e
+ rescue
+ # error will be logged in check_for_feedback
end
interruptible_sleep @poll
end
@@ -49,6 +49,9 @@ def check_for_feedback
timestamp, device_token = parse_tuple(tuple)
create_feedback(timestamp, device_token)
end
+ rescue StandardError => e
+ Rapns::Daemon.logger.error(e)
+ raise
ensure
connection.close if connection
end
View
2 spec/rapns/daemon/feedback_receiver_spec.rb
@@ -66,7 +66,7 @@ def connection.read(bytes)
error = StandardError.new('bork!')
connection.stub(:read).and_raise(error)
Rapns::Daemon.logger.should_receive(:error).with(error)
- receiever.check_for_feedback
+ lambda { receiever.check_for_feedback }.should raise_error
end
it 'sleeps for the feedback poll period' do

0 comments on commit 265a5f2

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