Sha256: dca1fd0947ad816018be0ae8cfe3bab7f2cf4ad4e926f5c4d687a52468805a63

Contents?: true

Size: 789 Bytes

Versions: 2

Compression:

Stored size: 789 Bytes

Contents

require 'spec_helper'
module Alf
  describe Ordering, 'dive' do

    subject{ ordering.dive(:b) }

    context 'when the ordering has :b' do
      let(:ordering){
        Ordering.new([[:a, :asc], [[:b, :x], :asc], [[:b, :y], :asc]])
      }
      let(:expected){
        Ordering.new([[:x, :asc], [:y, :asc]])
      }

      it{ should eq(expected) }
    end

    context 'when the ordering has no :b' do
      let(:ordering){
        Ordering.new([[:a, :asc]])
      }
      let(:expected){
        Ordering::EMPTY
      }

      it{ should eq(expected) }
    end

    context 'when the ordering has a single :b' do
      let(:ordering){
        Ordering.new([[:b, :asc]])
      }
      let(:expected){
        Ordering::EMPTY
      }

      it{ should eq(expected) }
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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