Sha256: fc90c836be5036bd80eaf2e738f3c2d025a1901a7c41cfe8c0d84a59928c797e

Contents?: true

Size: 604 Bytes

Versions: 2

Compression:

Stored size: 604 Bytes

Contents

require 'spec_helper'
module Alf
  describe Ordering, "to_attr_list" do

    subject{ ordering.to_attr_list }

    context 'on an empty ordering' do
      let(:ordering){ Ordering::EMPTY }

      it{ should eq(AttrList::EMPTY) }
    end

    context 'on an ordering with single names' do
      let(:ordering){ Ordering.new([[:a, :asc], [:b, :desc]]) }

      it{ should eq(AttrList[:a, :b]) }
    end

    context 'on an ordering with hirarchical names' do
      let(:ordering){ Ordering.new([[[:x, :a], :asc], [:b, :desc]]) }

      it{ should eq(AttrList[:x, :b]) }
    end

  end # Ordering
end # Alf

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alf-core-0.15.0 spec/unit/alf-types/ordering/test_to_attr_list.rb
alf-core-0.14.0 spec/unit/alf-types/ordering/test_to_attr_list.rb