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-0.4.0 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.3.0 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.2.0 spec/integration/virtus/instance_level_attributes_spec.rb
virtus-0.1.0 spec/integration/virtus/instance_level_attributes_spec.rb