Sha256: d790fd8bc17489453115c7e69c62aec231326c668cf599a48a100e758349242b

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 Bytes

Contents

require 'spec_helper'

shared_examples_for 'a sourced model' do

  # clazz must be defined by the calling file

  let(:model) { clazz.new }


  it 'has a source line' do
    expect(model).to respond_to(:source_line)
  end

  it 'can change its source line' do
    expect(model).to respond_to(:source_line=)

    model.source_line = :some_source_line
    expect(model.source_line).to eq(:some_source_line)
    model.source_line = :some_other_source_line
    expect(model.source_line).to eq(:some_other_source_line)
  end


  describe 'abstract instantiation' do

    context 'a new sourced object' do

      let(:model) { clazz.new }


      it 'starts with no source line' do
        expect(model.source_line).to be_nil
      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cuke_modeler-1.0.1 spec/unit/shared/sourced_models_unit_specs.rb
cuke_modeler-1.0.0 spec/unit/shared/sourced_models_unit_specs.rb