Sha256: 3dcb73a1e547e8aeab0e2e4d4d5c0b74222adc10f72dbbbecd69b4a5f28ee6be

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Attribute.new' do
  subject { object.new(name) }

  let(:name) { :id }

  [
    Attribute::Boolean,
    Attribute::Class,
    Attribute::Date,
    Attribute::DateTime,
    Attribute::Decimal,
    Attribute::Float,
    Attribute::Integer,
    Attribute::Numeric,
    Attribute::Object,
    Attribute::String,
    Attribute::Time,
  ].each do |klass|
    context "when called on the Attribute subclass #{klass}" do
      let(:object) { klass }

      it { should be_kind_of(object) }
    end
  end

  context 'when called on the Attribute class' do
    let(:object) { Attribute }

    specify { expect { subject }.to raise_error(NotImplementedError, "#{object} is an abstract class") }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/attribute/class_methods/new_spec.rb