Sha256: a5b68395c9edc5078ad999c0fe12b2f27cbc01866169547c73231fe560a15ad1
Contents?: true
Size: 1.55 KB
Versions: 2
Compression:
Stored size: 1.55 KB
Contents
# encoding: utf-8 require 'spec_helper' describe Algebra::Extension, '#delete' do subject { object.delete(other) } let(:object) { described_class.new(operand, extensions) } let(:operand) { Relation.new(header, LazyEnumerable.new([[1], [2]])) } let(:extensions) { { extension_attr => 1 } } let(:extension_attr) { Attribute::Integer.new(:test) } let(:header) { [[:id, Integer]] } context 'when other relation has matching extensions' do let(:other) do Relation.new(header, LazyEnumerable.new([[2]])).extend do |context| context.add(:test, 1) end end it { should be_instance_of(described_class) } its(:operand) { should be_kind_of(Relation) } its(:header) { should == [[:id, Integer], [:test, Integer]] } it 'deletes the tuples' do should == [[1, 1]] end end context 'when other relation does not have the same extensions' do let(:other) do Relation.new(header, LazyEnumerable.new([[2]])).extend do |context| context.add(:test, 2) end end specify { expect { subject }.to raise_error(ExtensionMismatchError, 'other relation must have matching extensions to be deleted') } end context 'when other relation is not an extension' do let(:other) { Relation.new(header, LazyEnumerable.new([[2]])) } specify { expect { subject }.to raise_error(ExtensionMismatchError, 'other relation must have matching extensions to be deleted') } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
axiom-0.2.0 | spec/unit/axiom/algebra/extension/delete_spec.rb |
axiom-0.1.1 | spec/unit/axiom/algebra/extension/delete_spec.rb |