Sha256: 25db7258cf50e8497b61bcc2342215ffb9e7bb627430cfb7a5cf03a3081bff68

Contents?: true

Size: 949 Bytes

Versions: 1

Compression:

Stored size: 949 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Relation::Materialized, '.new' do
  let(:header) { Relation::Header.coerce([ [ :id, Integer ] ]) }
  let(:tuples) { [ [ 1 ] ]                                     }
  let(:object) { described_class                               }

  context 'with directions' do
    subject { object.new(header, tuples, directions) }

    let(:directions) { [ header[:id] ] }

    it { should be_instance_of(object) }

    its(:header) { should equal(header) }

    its(:directions) do
      should be_instance_of(Relation::Operation::Order::DirectionSet)
      should == directions
    end

    it { should == tuples }
  end

  context 'with no directions' do
    subject { object.new(header, tuples) }

    it { should be_instance_of(object) }

    its(:header) { should equal(header) }

    its(:directions) { should equal(Relation::Operation::Order::DirectionSet::EMPTY) }

    it { should == tuples }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.0 spec/unit/axiom/relation/materialized/class_methods/new_spec.rb