Sha256: 794dd2ee85d7772c1d85c00d9dc3b5165800024efae4f19d9f835300c5718ee6

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Operation::Order::DirectionSet, '#reverse' do
  subject { object.reverse }

  let(:attribute1) { Attribute::Integer.new(:id)                        }
  let(:attribute2) { Attribute::String.new(:name)                       }
  let(:object)     { described_class.coerce([ attribute1, attribute2 ]) }

  it_should_behave_like 'an idempotent method'

  it { should be_instance_of(described_class) }

  it 'reverses each direction' do
    should == [ attribute1.desc, attribute2.desc ]
  end

  it 'does not reverse the attribute order' do
    subject.attributes.should eql([ attribute1, attribute2 ])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.0 spec/unit/axiom/relation/operation/order/direction_set/reverse_spec.rb