Sha256: 7f4cc9f4615f7e41546fb47515a832059a0195e5eec59b911203bae048924982

Contents?: true

Size: 784 Bytes

Versions: 1

Compression:

Stored size: 784 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe 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 |described_class|
    context "when called on the Attribute subclass #{described_class}" do
      let(:object) { described_class }

      it { should be_kind_of(object) }
    end
  end

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

    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.4 spec/unit/veritas/attribute/class_methods/new_spec.rb