Sha256: 2d79e32d1f6563441d75991b6a5b9ceeef9bdbe2293bd57aa9c5ca5ff3594f69

Contents?: true

Size: 609 Bytes

Versions: 2

Compression:

Stored size: 609 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Algebra::Rename::Aliases, '#each' do
  subject { object.each { |old_attr, new_attr| yields << [old_attr, new_attr] } }

  let(:object)    { described_class.new(aliases)                 }
  let(:aliases)   { { attribute => attribute.rename(:other_id) } }
  let(:attribute) { Attribute::Integer.new(:id)                  }
  let(:yields)    { []                                           }

  it_should_behave_like 'an #each method'

  it 'yields each alias' do
    expect { subject }.to change { yields.dup }
      .from([])
      .to(aliases.to_a)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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