<commit_before># encoding: utf-8

require 'spec_helper'

module Punchblock
  class Event
    describe Complete do
      it 'registers itself' do
        RayoNode.class_from_registration(:complete, 'urn:xmpp:rayo:ext:1').should be == Complete
      end

      describe "comparing for equality" do
        subject do
          Complete.new.tap do |c|
            c.reason          = Complete::Stop.new
            c.target_call_id  = '1234'
            c.component_id    = 'abcd'
          end
        end<commit_msg>[CS] Add test coverage for setting and reading complete reason<commit_after># encoding: utf-8

require 'spec_helper'

module Punchblock
  class Event
    describe Complete do
      it 'registers itself' do
        RayoNode.class_from_registration(:complete, 'urn:xmpp:rayo:ext:1').should be == Complete
      end

      describe "setting a reason" do
        let(:reason) { Punchblock::Component::Asterisk::AGI::Command::Complete::Success.new }

        subject { described_class.new }

        before { subject.reason = reason }

        its(:reason) { should == reason }
      end

      describe "comparing for equality" do
        subject do
          Complete.new.tap do |c|
            c.reason          = Complete::Stop.new
            c.target_call_id  = '1234'
            c.component_id    = 'abcd'
          end
        end
{'fraction_non_alphanumeric': 0.0904373610081542, 'fraction_numerical': 0.008895478131949592, 'mean_word_length': 2.1468531468531467, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3297530', 'n_tokens_mistral': 401, 'n_tokens_neox': 383, 'n_words': 102}