Sha256: 7e4993a4fb6fd0ba311e24730b9e29f7af0c33f22a0515214963963834627f44

Contents?: true

Size: 720 Bytes

Versions: 13

Compression:

Stored size: 720 Bytes

Contents

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

shared_examples_for 'a named model' do

  # clazz must be defined by the calling file

  let(:model) { clazz.new }


  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 named object' do

      let(:model) { clazz.new }


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

    end

  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cuke_modeler-2.1.0 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-2.0.0 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.5.1 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.5.0 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.4.0 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.3.0 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.2.1 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.2.0 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.1.1 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.1.0 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.0.4 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.0.3 testing/rspec/spec/unit/shared/named_models_unit_specs.rb
cuke_modeler-1.0.2 testing/rspec/spec/unit/shared/named_models_unit_specs.rb