Sha256: daf38b350a28b18518db52d4d40be383944f337de310579d8f10ce949efd0d2d

Contents?: true

Size: 1.51 KB

Versions: 21

Compression:

Stored size: 1.51 KB

Contents

shared_examples_for "match" do
  subject do
    described_class.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
      described_class.new(:mode => :dtmf, :confidence => 1, :utterance => '6', :interpretation => 'foo').should == described_class.new(:mode => :dtmf, :confidence => 1, :utterance => '6', :interpretation => 'foo')
    end

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

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

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

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ruby_speech-2.4.0-java spec/support/match_examples.rb
ruby_speech-2.4.0 spec/support/match_examples.rb
ruby_speech-2.3.2-java spec/support/match_examples.rb
ruby_speech-2.3.2 spec/support/match_examples.rb
ruby_speech-2.3.1-java spec/support/match_examples.rb
ruby_speech-2.3.1 spec/support/match_examples.rb
ruby_speech-2.3.0-java spec/support/match_examples.rb
ruby_speech-2.3.0 spec/support/match_examples.rb
ruby_speech-2.2.2-java spec/support/match_examples.rb
ruby_speech-2.2.2 spec/support/match_examples.rb
ruby_speech-2.2.1-java spec/support/match_examples.rb
ruby_speech-2.2.1 spec/support/match_examples.rb
ruby_speech-2.2.0-java spec/support/match_examples.rb
ruby_speech-2.2.0 spec/support/match_examples.rb
ruby_speech-2.1.2-java spec/support/match_examples.rb
ruby_speech-2.1.2 spec/support/match_examples.rb
ruby_speech-2.1.1-java spec/support/match_examples.rb
ruby_speech-2.1.1 spec/support/match_examples.rb
ruby_speech-2.1.0-java spec/support/match_examples.rb
ruby_speech-2.1.0 spec/support/match_examples.rb