Sha256: a103a7cb8ac77f23a714ab33abaee144e3d0fa50f878a39773d4bdfb330b399f

Contents?: true

Size: 931 Bytes

Versions: 1

Compression:

Stored size: 931 Bytes

Contents

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

describe 'Veritas::Logic::Connective::Unary#rename' do
  subject { object.rename(aliases) }

  let(:klass)     { 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)    { klass.new(operand)                                        }

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

    it { should be_kind_of(klass) }

    its(:operand) { should == 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.2 spec/unit/veritas/logic/connective/unary/rename_spec.rb