Sha256: b93df23395fd094205c9fbeb26801e88becdbc12ac953da730417385ba9b597e

Contents?: true

Size: 729 Bytes

Versions: 1

Compression:

Stored size: 729 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Algebra::Rename::Aliases, '#to_hash' do
  subject { object.to_hash }

  let(:attribute) { Attribute::Integer.new(:id)  }
  let(:object)    { described_class.new(aliases) }

  context 'when aliases is frozen' do
    let(:aliases) { { attribute => attribute.rename(:other_id) }.freeze }

    it_should_behave_like 'an idempotent method'

    it { should equal(aliases) }
  end

  context 'when aliases is not frozen' do
    let(:aliases) { { attribute => attribute.rename(:other_id) } }

    it_should_behave_like 'an idempotent method'

    it { should_not equal(aliases) }

    it { should be_kind_of(Hash) }

    it { should == aliases }

    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/algebra/rename/aliases/to_hash_spec.rb