Sha256: b223e596a787fa432c86bb33c6e5f86f044e444d3f36f7f5c8ed2727666fd312

Contents?: true

Size: 727 Bytes

Versions: 2

Compression:

Stored size: 727 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 be(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 be(aliases) }

    it { should be_instance_of(Hash) }

    it { should == aliases }

    it { should be_frozen }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
axiom-0.2.0 spec/unit/axiom/algebra/rename/aliases/to_hash_spec.rb
axiom-0.1.1 spec/unit/axiom/algebra/rename/aliases/to_hash_spec.rb