Sha256: 4bdadda1985fcfad853959ff94567e996da9e7dfc85610f07f4faa5a6c9aef87

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 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

1 entries across 1 versions & 1 rubygems

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