Sha256: 7e450ea83405cd9360e69af798ebef0e983198c23ea1a89df21e46fc7f37d720

Contents?: true

Size: 653 Bytes

Versions: 1

Compression:

Stored size: 653 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.new([ attribute1, attribute2 ]) }

  it_should_behave_like 'an idempotent method'

  it { should be_kind_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 == [ attribute1, attribute2 ]
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.4 spec/unit/veritas/relation/operation/order/direction_set/reverse_spec.rb