Sha256: 2d41d723e0f5a68abc9eeb12ae1ea22e38cdde984b1f9cc0d8e2dd4a26520f31

Contents?: true

Size: 532 Bytes

Versions: 2

Compression:

Stored size: 532 Bytes

Contents

require 'spec_helper'

describe MemoryModel::Base::Fieldable do

  let(:model_a) { Class.new(MemoryModel::Base) }
  let(:model_b) { Class.new(MemoryModel::Base) }

  describe '.field' do
    it 'should add a field to fields' do
      field = :foo
      model_a.send :field, field
      model_a.fields.should include field
    end

    it 'should not dirty other classes' do
      field = :bar
      model_a.send :field, field
      model_a.fields.should include field
      model_b.fields.should_not include field
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
memory_model-0.0.2 spec/memory_model/base/fieldable_spec.rb
memory_model-0.0.1 spec/memory_model/base/fieldable_spec.rb