Sha256: 5d208ffeea36c449dea9d2777652bb999fb9c629d197754ace8cd148a0c86945

Contents?: true

Size: 760 Bytes

Versions: 1

Compression:

Stored size: 760 Bytes

Contents

require 'spec_helper'

describe 'Veritas::Algebra::Extension.new' do
  subject { object.new(operand, extensions) }

  let(:operand) { Relation.new([ [ :id, Integer ], [ :name, String ] ], [ [ 1, 'Dan Kubb' ], [ 2, 'Dan Kubb' ] ]) }
  let(:object)  { Algebra::Extension                                                                              }

  context 'with a unique attribute name provided' do
    let(:extensions) { { :unique => lambda { |tuple| 1 } } }

    it { should be_kind_of(object) }
  end

  context 'with a duplicate attribute name provided' do
    let(:extensions) { { :id => proc {}, :name => proc {} } }

    specify { expect { subject }.to raise_error(DuplicateHeaderName, 'extensions with duplicate header names: id, name') }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
veritas-0.0.2 spec/unit/veritas/algebra/extension/class_methods/new_spec.rb