Sha256: 6da00010dc343496ab566a7f272d4ea97a3de4bc65cea2ec4cd8ccaae8f4bb27
Contents?: true
Size: 1.6 KB
Versions: 14
Compression:
Stored size: 1.6 KB
Contents
require 'spec_helper' module RubySpeech module SSML describe Sub do its(:name) { should == 'sub' } describe "setting options in initializers" do subject { Sub.new :alias => 'foo' } its(:alias) { should == 'foo' } end it 'registers itself' do Element.class_from_registration(:sub).should == Sub end describe "from a document" do let(:document) { '<sub alias="foo"/>' } subject { Element.import document } it { should be_instance_of Sub } its(:alias) { should == 'foo' } end describe "comparing objects" do it "should be equal if the content and alias are the same" do Sub.new(:alias => 'jp', :content => "Hello there").should == Sub.new(:alias => 'jp', :content => "Hello there") end describe "when the content is different" do it "should not be equal" do Sub.new(:content => "Hello").should_not == Sub.new(:content => "Hello there") end end describe "when the alias is different" do it "should not be equal" do Sub.new(:alias => 'jp').should_not == Sub.new(:alias => 'en') end end end describe "<<" do it "should accept String" do lambda { subject << 'anything' }.should_not raise_error end it "should raise InvalidChildError with non-acceptable objects" do lambda { subject << Voice.new }.should raise_error(InvalidChildError, "A Sub can only accept Strings as children") end end end # Desc end # SSML end # RubySpeech
Version data entries
14 entries across 14 versions & 1 rubygems