Permalink
Browse files

Adding Call#remove_tag

  • Loading branch information...
1 parent e4c09a7 commit b65a72052d0e8c570fee3007b053efcbd0696fd2 Jay Phillips committed Aug 29, 2008
Showing with 15 additions and 1 deletion.
  1. +6 −1 lib/adhearsion/voip/call.rb
  2. +9 −0 spec/voip/test_dialplan_manager.rb
@@ -88,7 +88,6 @@ def initialize(call)
end
end
-
class FailedExtensionCallException < MetaAgiCallException; end
class HungupExtensionCallException < MetaAgiCallException; end
@@ -167,6 +166,12 @@ def tag(symbol)
end
end
+ def remove_tag(symbol)
+ @tag_mutex.synchronize do
+ @tags.reject! { |tag| tag == symbol }
+ end
+ end
+
def tagged_with?(symbol)
@tag_mutex.synchronize do
@tags.include? symbol
@@ -123,6 +123,15 @@ def mock_dial_plan_lookup_for_context_name
call.tagged_with?(:authorized).should.equal false
end
+ test "Call#remove_tag" do
+ call = new_call_for_context "roflcopter"
+ call.tag :moderator
+ call.tag :female
+ call.remove_tag :female
+ call.tag :male
+ call.tags.should == [:moderator, :male]
+ end
+
test 'Call#tagged_with? with many tags' do
call = new_call_for_context "roflcopter"
call.tag :customer

0 comments on commit b65a720

Please sign in to comment.