Sha256: 53d5ab63dd42d92784da725e43cd6c010ea52ed353009a38f0a5c5e17cd40a49

Contents?: true

Size: 1.61 KB

Versions: 7

Compression:

Stored size: 1.61 KB

Contents

require 'spec_helper'

module RubySpeech
  module GRXML
    describe Match do
      subject do
        Match.new :mode           => :dtmf,
                  :confidence     => 1,
                  :utterance      => '6',
                  :interpretation => 'foo'
      end

      its(:mode)            { should == :dtmf }
      its(:confidence)      { should == 1 }
      its(:utterance)       { should == '6' }
      its(:interpretation)  { should == 'foo' }

      describe "equality" do
        it "should be equal when mode, confidence, utterance and interpretation are the same" do
          Match.new(:mode => :dtmf, :confidence => 1, :utterance => '6', :interpretation => 'foo').should == Match.new(:mode => :dtmf, :confidence => 1, :utterance => '6', :interpretation => 'foo')
        end

        describe "when the mode is different" do
          it "should not be equal" do
            Match.new(:mode => :dtmf).should_not == Match.new(:mode => :speech)
          end
        end

        describe "when the confidence is different" do
          it "should not be equal" do
            Match.new(:confidence => 1).should_not == Match.new(:confidence => 0)
          end
        end

        describe "when the utterance is different" do
          it "should not be equal" do
            Match.new(:utterance => '6').should_not == Match.new(:utterance => 'foo')
          end
        end

        describe "when the interpretation is different" do
          it "should not be equal" do
            Match.new(:interpretation => 'foo').should_not == Match.new(:interpretation => 'bar')
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ruby_speech-2.0.1 spec/ruby_speech/grxml/match_spec.rb
ruby_speech-1.1.0 spec/ruby_speech/grxml/match_spec.rb
ruby_speech-1.0.2 spec/ruby_speech/grxml/match_spec.rb
ruby_speech-1.0.1 spec/ruby_speech/grxml/match_spec.rb
ruby_speech-1.0.0 spec/ruby_speech/grxml/match_spec.rb
ruby_speech-0.5.1 spec/ruby_speech/grxml/match_spec.rb
ruby_speech-0.5.0 spec/ruby_speech/grxml/match_spec.rb