Sha256: 76c840b7930eddf556fc7fadc480768d244e1590e9ca686788464e754c5476db

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

module RubySpeech
  module GRXML
    describe Tag do
      its(:name) { should == 'tag' }

      it 'registers itself' do
        Element.class_from_registration(:tag).should == Tag
      end

      describe "from a document" do
        let(:document) { '<tag>hello</tag>' }

        subject { Element.import parse_xml(document).root }

        it { should be_instance_of Tag }

        its(:content) { should == 'hello' }
      end

      describe "comparing objects" do
        it "should be equal if the content is the same" do
          Tag.new(:content => "hello").should == Tag.new(:content => "hello")
        end

        describe "when the content is different" do
          it "should not be equal" do
            Tag.new(:content => "Hello").should_not == Tag.new(:content => "Hello there")
          end
        end
      end

      describe "<<" do
        it "should accept String" do
          lambda { subject << 'anything' }.should_not raise_error
        end
      end
    end # Tag
  end # GRXML
end # RubySpeech

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby_speech-0.4.0 spec/ruby_speech/grxml/tag_spec.rb
ruby_speech-0.3.4 spec/ruby_speech/grxml/tag_spec.rb
ruby_speech-0.3.3 spec/ruby_speech/grxml/tag_spec.rb
ruby_speech-0.3.2 spec/ruby_speech/grxml/tag_spec.rb
ruby_speech-0.3.1 spec/ruby_speech/grxml/tag_spec.rb
ruby_speech-0.3.0 spec/ruby_speech/grxml/tag_spec.rb