Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

Commit

Permalink
add spec for notification center
Browse files Browse the repository at this point in the history
  • Loading branch information
siuying committed May 29, 2012
1 parent 1376c5b commit dba25c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/ns_notification_center_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@

it "add observer" do
notified = false
notification_center.observe(@observer, SampleNotification) do
notification_center.observe(@observer, SampleNotification) do |note|
notified = true
note.class.should == NSNotification
note.object.class.should == Time
note.userInfo.should.not.be.nil
note.userInfo[:status].should == "ok"
end

lambda {
notification_center.post SampleNotification
notification_center.post SampleNotification, Time.now, {:status => "ok"}
}.should.change { notified }
end

Expand Down

0 comments on commit dba25c6

Please sign in to comment.