Sha256: fc5bec911d61488e614c6619db1dcc22d9fc5122113e5078565ffa8b1957c191

Contents?: true

Size: 710 Bytes

Versions: 1

Compression:

Stored size: 710 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Algebra::Projection::Methods, '#project' do
  subject { object.project(attributes) }

  let(:described_class) { Relation                                                                                 }
  let(:attributes)      { [ :id ]                                                                                  }
  let(:object)          { described_class.new([ [ :id, Integer ], [ :name, String ] ], [ [ 1, 'Dan Kubb' ] ].each) }

  it { should be_kind_of(Algebra::Projection) }

  its(:header) { should == [ [ :id, Integer ] ] }

  it 'behaves the same as Enumerable#map with Tuple#[]' do
    should == object.map { |tuple| [ tuple[:id] ] }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.4 spec/unit/veritas/algebra/projection/methods/project_spec.rb