Sha256: c0991d1405456ceea956ea3c551c3b4a368c84917e6a046b539ebfc49328bc4e

Contents?: true

Size: 930 Bytes

Versions: 4

Compression:

Stored size: 930 Bytes

Contents

require 'spec_helper'

describe Virtus::Attribute::Object, '.descendants' do
  subject { described_class.descendants.map { |c| c.to_s }.sort }

  before { pending 'Remove this spec in favor of Virtus::DescentantsTracker spec' }

  let(:known_descendants) do
    [ Virtus::Attribute::EmbeddedValue, Virtus::Attribute::Symbol,
      Virtus::Attribute::Time,          Virtus::Attribute::String,
      Virtus::Attribute::Integer,       Virtus::Attribute::Hash,
      Virtus::Attribute::Float,         Virtus::Attribute::Decimal,
      Virtus::Attribute::Numeric,       Virtus::Attribute::DateTime,
      Virtus::Attribute::Date,          Virtus::Attribute::Boolean,
      Virtus::Attribute::Set,           Virtus::Attribute::Array,
      Virtus::Attribute::Collection,    Virtus::Attribute::Class ].map { |a| a.to_s }.sort
  end

  it 'should return all known attribute classes' do
    subject.should eql(known_descendants)
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/virtus-0.5.2/spec/unit/virtus/attribute/object/class_methods/descendants_spec.rb
virtus-0.5.2 spec/unit/virtus/attribute/object/class_methods/descendants_spec.rb
virtus-0.5.1 spec/unit/virtus/attribute/object/class_methods/descendants_spec.rb
virtus-0.5.0 spec/unit/virtus/attribute/object/class_methods/descendants_spec.rb