spec/unit/client/entity_spec.rb in amq-client-0.7.0.alpha13 vs spec/unit/client/entity_spec.rb in amq-client-0.7.0.alpha14
- old
+ new
@@ -10,9 +10,20 @@
it "should maintain an associative array of callbacks" do
subject.callbacks.should be_kind_of(Hash)
end
+ describe "#has_callback?" do
+ it "should return true if entity has at least one callback with given name" do
+ subject.define_callback(:init, proc {})
+ subject.has_callback?(:init).should be_true
+ end
+
+ it "should return false if entity doesn't have callbacks with given name" do
+ subject.has_callback?(:init).should be_false
+ end
+ end
+
describe "#exec_callback" do
it "executes callback for given event" do
proc = Proc.new { |*args, &block|
@called = true
}