Sha256: 51296903797f6385f61ad88f01bb0cf3404a0c10b6cb8e984c03aeda2585b73c

Contents?: true

Size: 723 Bytes

Versions: 2

Compression:

Stored size: 723 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]], LazyEnumerable.new([[1, 'Dan Kubb']])) }

  it { should be_instance_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

2 entries across 2 versions & 1 rubygems

Version Path
axiom-0.2.0 spec/unit/axiom/algebra/projection/methods/project_spec.rb
axiom-0.1.1 spec/unit/axiom/algebra/projection/methods/project_spec.rb