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) }

  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

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

Mark broken spec as pending for Ruby < 1.9
Mark broken spec as pending for Ruby < 1.9
