Sha256: c9ec8bc1e6af4c18aab7cb0eb3dabbe3dc655660d7f09117524f8fbebbf3d4a4

Contents?: true

Size: 982 Bytes

Versions: 1

Compression:

Stored size: 982 Bytes

Contents

# encoding: utf-8

require 'spec_helper'
require File.expand_path('../fixtures/classes', __FILE__)

describe Function::Unary, '#rename' do
  subject { object.rename(aliases) }

  let(:described_class) { UnarySpecs::Object                                        }
  let(:attribute)       { Attribute::Integer.new(:id)                               }
  let(:other)           { attribute.rename(:other_id)                               }
  let(:header)          { Relation::Header.new([ attribute ])                       }
  let(:aliases)         { Algebra::Rename::Aliases.coerce(header, :id => :other_id) }
  let(:object)          { described_class.new(operand)                              }

  context 'operand is renamed' do
    let(:operand) { attribute.eq(1) }

    it { should be_kind_of(described_class) }

    its(:operand) { should eql(other.eq(1)) }
  end

  context 'operand is not renamed' do
    let(:operand) { other.eq(1) }

    it { should equal(object) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.4 spec/unit/veritas/function/unary/rename_spec.rb