Sha256: 0c413d90a7950a8fafde6e43618b55d06d607f16e39074834e63c4936d10da47

Contents?: true

Size: 607 Bytes

Versions: 4

Compression:

Stored size: 607 Bytes

Contents

require 'spec_helper'

describe Virtus::Attribute::Class do
  it_should_behave_like 'Attribute' do
    let(:attribute_name)         { :String }
    let(:attribute_value)        { String }
    let(:attribute_value_other)  { 'String' }
    let(:attribute_default)      { 'Object' }
    let(:attribute_default_proc) { lambda { |instance, attribute| attribute.name.to_s } }
  end

  describe '#coerce' do
    let(:attribute) { described_class.new(:type) }

    subject { attribute.coerce(value) }

    context 'with a String' do
      let(:value) { 'String' }

      it { should be(String) }
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
virtus-0.0.10 spec/unit/virtus/attribute/class_spec.rb
virtus-0.0.9 spec/unit/virtus/attribute/class_spec.rb
virtus-0.0.8 spec/unit/virtus/attribute/class_spec.rb
virtus-0.0.7 spec/unit/virtus/attribute/class_spec.rb