Sha256: 88c49c88a0c400d6d3fe7e232032a55fefe753832cf12e5ca4545669d1231fca

Contents?: true

Size: 1.17 KB

Versions: 3

Compression:

Stored size: 1.17 KB

Contents

require "#{File.dirname(__FILE__)}/../spec_helper"


describe 'Tag, Unit', :unit_test => true do

  let(:clazz) { CukeModeler::Tag }
  let(:model) { clazz.new }


  describe 'common behavior' do

    it_should_behave_like 'a model'
    it_should_behave_like 'a sourced model'
    it_should_behave_like 'a parsed model'

  end


  describe 'unique behavior' do

    it 'has a name' do
      expect(model).to respond_to(:name)
    end

    it 'can change its name' do
      expect(model).to respond_to(:name=)

      model.name = :some_name
      expect(model.name).to eq(:some_name)
      model.name = :some_other_name
      expect(model.name).to eq(:some_other_name)
    end


    describe 'abstract instantiation' do

      context 'a new tag object' do

        let(:tag) { clazz.new }


        it 'starts with no name' do
          expect(tag.name).to be_nil
        end

      end

    end

  end


  describe 'tag output' do

    context 'from abstract instantiation' do

      let(:tag) { clazz.new }


      it 'can output an empty tag' do
        expect { tag.to_s }.to_not raise_error
      end

    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cuke_modeler-1.5.0 testing/rspec/spec/unit/tag_unit_spec.rb
cuke_modeler-1.4.0 testing/rspec/spec/unit/tag_unit_spec.rb
cuke_modeler-1.3.0 testing/rspec/spec/unit/tag_unit_spec.rb