Sha256: 04e230e0fd7e7fdf68cf5172104dbadab49c636edbdd9f3d8be1da305d51dbb9

Contents?: true

Size: 653 Bytes

Versions: 1

Compression:

Stored size: 653 Bytes

Contents

require 'spec_helper'

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

  let(:klass)      { Relation                                                                       }
  let(:attributes) { [ :id ]                                                                        }
  let(:object)     { klass.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.2 spec/unit/veritas/algebra/projection/methods/project_spec.rb