Sha256: 57d49ca8542180aa85738ec553b5b8664e141b968a576399267a8762cbb1a23e

Contents?: true

Size: 834 Bytes

Versions: 1

Compression:

Stored size: 834 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Attribute, '#options' do
  subject { object.options }

  let(:described_class) { Attribute::Integer }

  context 'when no options are provided' do
    let(:object) { described_class.new(:id) }

    it { should be_kind_of(Hash) }

    it { should be_empty }

    it { should be_frozen }
  end

  context 'when options are frozen' do
    let(:options) { {}.freeze                         }
    let(:object)  { described_class.new(:id, options) }

    it { should equal(options) }
  end

  context 'when options are not frozen' do
    let(:options) { {}                                }
    let(:object)  { described_class.new(:id, options) }

    it { should_not equal(options) }

    it { should be_kind_of(Hash) }

    it { should == options }

    it { should be_frozen }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.4 spec/unit/veritas/attribute/options_spec.rb