Sha256: 383716e1865c44fd7bac5f02f41033c8affa5052de89d594497403ab698fb7de

Contents?: true

Size: 505 Bytes

Versions: 17

Compression:

Stored size: 505 Bytes

Contents

require 'spec_helper'

RSpec.describe Yaks::Mapper::Attribute do
  include_context 'yaks context'

  subject(:attribute) { described_class.new(:the_name) }
  fake(:mapper)

  its(:name) { should be :the_name }

  before do
    stub(mapper).load_attribute(:the_name) { 123 }
  end

  it 'should add itself to a resource based on a lookup' do
    expect(attribute.add_to_resource(Yaks::Resource.new, mapper , yaks_context)).to eql(
      Yaks::Resource.new(attributes: { :the_name => 123 })
    )
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
yaks-0.7.7 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.7.6 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.7.5 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.7.4 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.7.3 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.7.2 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.7.1 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.7.0 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.6.2 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.6.1 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.6.0 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.6.0.alpha.1 spec/unit/yaks/mapper/attribute_spec.rb
yaks-html-0.6.0.alpha yaks/spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.6.0.alpha yaks/spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.5.0 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.4.4 spec/unit/yaks/mapper/attribute_spec.rb
yaks-0.4.3 spec/unit/yaks/mapper/attribute_spec.rb