Sha256: 01b39828fd0879fb0d3c42afa6589d3bad2b6b1ea083fee3e5f0f9a418354331

Contents?: true

Size: 502 Bytes

Versions: 24

Compression:

Stored size: 502 Bytes

Contents

require 'spec_helper'

describe Virtus, 'instance level attributes' do
  subject do
    subject = Object.new
    subject.singleton_class.send(:include, Virtus)
    subject
  end

  let(:attribute) { subject.singleton_class.attribute(:name, String) }

  before do
    pending if RUBY_VERSION < '1.9'
  end

  context 'adding an attribute' do
    it 'allows setting the attribute value on the instance' do
      attribute
      subject.name = 'foo'
      subject.name.should eql('foo')
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
virtus-1.0.2 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.1 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.0 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.0.rc2 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.0.rc1 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.0.beta8 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.0.beta7 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.0.beta6 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.0.beta5 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.0.beta4 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-1.0.0.beta3 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.5.5 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.5.4 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.5.3 spec/integration/virtus/instance_level_attributes_spec.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.5.2 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.5.1 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.5.0 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.4.2 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.4.1 spec/integration/virtus/instance_level_attributes_spec.rb