Sha256: 44da67e3ded91d19705ce1a97a928b3ac152606435870fc1b52bf3ec5250295f

Contents?: true

Size: 733 Bytes

Versions: 4

Compression:

Stored size: 733 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_instance_of(Hash) }

    it { should == aliases }

    it { should be_frozen }
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
axiom-0.1.0 spec/unit/axiom/algebra/rename/aliases/to_hash_spec.rb
veritas-0.0.7 spec/unit/veritas/algebra/rename/aliases/to_hash_spec.rb
veritas-0.0.6 spec/unit/veritas/algebra/rename/aliases/to_hash_spec.rb
veritas-0.0.5 spec/unit/veritas/algebra/rename/aliases/to_hash_spec.rb