Sha256: 5f322fabfc0138a4ade24d3d2f2970cdf9e57a22b5c964edb8bc49e808defc85

Contents?: true

Size: 686 Bytes

Versions: 1

Compression:

Stored size: 686 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Header, '#rename' do
  subject { object.rename(aliases) }

  let(:object)  { described_class.coerce([ [ :id, Integer ], [ :name, String ] ], :keys => keys) }
  let(:aliases) { Algebra::Rename::Aliases.coerce(object, :id => :other_id)                      }
  let(:keys)    { Relation::Keys.new([ described_class.coerce([ [ :id, Integer ] ]) ])           }

  it { should be_instance_of(described_class) }

  it { should_not equal(object) }

  its(:to_ary) { should == [ [ :other_id, Integer ], [ :name, String ] ] }

  its(:keys) { should eql(Relation::Keys.new([ described_class.coerce([ [ :other_id, Integer ] ]) ])) }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.0 spec/unit/axiom/relation/header/rename_spec.rb