Sha256: 4dcd438be2ab0f4dbfbfcb7ccff13176e220c1e0b40ec0730b79e1c1faadde00

Contents?: true

Size: 781 Bytes

Versions: 1

Compression:

Stored size: 781 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Algebra::Rename, '#directions' do
  subject { object.directions }

  let(:relation) { Relation.new([ [ :id, Integer ] ], [].each)    }
  let(:object)   { described_class.new(operand, :id => :other_id) }

  context 'containing a relation' do
    let(:operand) { relation }

    it_should_behave_like 'an idempotent method'

    it { should be_kind_of(Relation::Operation::Order::DirectionSet) }

    it { should be_empty }
  end

  context 'containing an ordered relation' do
    let(:operand) { relation.order { [ relation[:id] ] } }

    it_should_behave_like 'an idempotent method'

    it { should be_kind_of(Relation::Operation::Order::DirectionSet) }

    it { should == [ Attribute::Integer.new(:other_id).asc ] }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.4 spec/unit/veritas/algebra/rename/directions_spec.rb