Permalink
Browse files

leave notices as well

  • Loading branch information...
1 parent 2c2d9b0 commit a69cc930e93235840f69fc6abae8b53e2f212eaa @outerim outerim committed Jun 18, 2009
Showing with 21 additions and 0 deletions.
  1. +21 −0 spec/protocol_spec.rb
View
@@ -22,5 +22,26 @@ class DummyActor < Pelvis::Actor; end
}
}
end
+
+ if ENV['PROTOCOL'] = 'xmpp'
+ it "should call the block when the specified identity leaves" do
+ block = Proc.new { |id, status|
+ if status != :available
+ id.should == identity_for(:foo)
+ status.should == :unavailable
+ EM.stop
+ end
+ }
+
+ @agents = [[:herault]]
+ start_agents { |agent|
+ agent.protocol.subscribe_presence(identity_for(:foo), &block)
+ connect(:foo) { |foo_agent|
+ EM.add_timer(10) { raise "Didn't get subscription advertisement" }
+ foo_agent.protocol.stream.instance_eval { stop }
+ }
+ }
+ end
+ end
end
end

0 comments on commit a69cc93

Please sign in to comment.