Sha256: 8574e9815543c7a5678b0bbf72f79e7df500ca3241b4f28b0f35086147fc2f8d

Contents?: true

Size: 531 Bytes

Versions: 2

Compression:

Stored size: 531 Bytes

Contents

require 'spec_helper'
module Alf
  describe Ordering, "[]" do

    let(:ordering){ Ordering.new([[:a, :asc], [:b, :desc], [[:c, :d], :asc]]) }

    it 'return the direction when an attribute' do
      ordering[:a].should eq(:asc)
      ordering[:b].should eq(:desc)
      ordering[Selector[:a]].should eq(:asc)
      ordering[Selector[:b]].should eq(:desc)
      ordering[Selector[[:c, :d]]].should eq(:asc)
    end

    it 'return nil when not an attribute' do
      ordering[:c].should be_nil
    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_hash_get.rb
alf-core-0.14.0 spec/unit/alf-types/ordering/test_hash_get.rb