Skip to content

Commit

Permalink
Change Relation::Empty.new to use Relation.new with no body
Browse files Browse the repository at this point in the history
  • Loading branch information
dkubb committed Jul 25, 2013
1 parent 2a4ca76 commit 7e482dc
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 47 deletions.
12 changes: 6 additions & 6 deletions spec/integration/axiom/algebra/difference/optimize_spec.rb
Expand Up @@ -19,8 +19,8 @@
end

context 'left is an empty relation' do
let(:left) { Relation::Empty.new(header) }
let(:right) { original_right }
let(:left) { Relation.new(header) }
let(:right) { original_right }

it { should be(left) }

Expand All @@ -37,8 +37,8 @@
end

context 'right is an empty relation' do
let(:left) { original_left }
let(:right) { Relation::Empty.new(header) }
let(:left) { original_left }
let(:right) { Relation.new(header) }

it { should be(left) }

Expand All @@ -58,7 +58,7 @@
let(:left) { Algebra::Restriction.new(original_left, Function::Proposition::Contradiction.instance) }
let(:right) { original_right }

it { should eql(Relation::Empty.new(left.header | right.header)) }
it { should eql(Relation.new(left.header | right.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down Expand Up @@ -106,7 +106,7 @@
let(:left) { original_left }
let(:right) { original_right }

it { should eql(Relation::Empty.new(header)) }
it { should eql(Relation.new(header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down
12 changes: 6 additions & 6 deletions spec/integration/axiom/algebra/intersection/optimize_spec.rb
Expand Up @@ -19,8 +19,8 @@
end

context 'left is an empty relation' do
let(:left) { Relation::Empty.new(header) }
let(:right) { original_right }
let(:left) { Relation.new(header) }
let(:right) { original_right }

it { should be(left) }

Expand All @@ -37,8 +37,8 @@
end

context 'right is an empty relation' do
let(:left) { original_left }
let(:right) { Relation::Empty.new(header) }
let(:left) { original_left }
let(:right) { Relation.new(header) }

it { should be(right) }

Expand All @@ -58,7 +58,7 @@
let(:left) { Algebra::Restriction.new(original_left, Function::Proposition::Contradiction.instance) }
let(:right) { original_right }

it { should eql(Relation::Empty.new(left.header | right.header)) }
it { should eql(Relation.new(left.header | right.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand All @@ -81,7 +81,7 @@
let(:left) { original_left }
let(:right) { Algebra::Restriction.new(original_right, Function::Proposition::Contradiction.instance) }

it { should eql(Relation::Empty.new(left.header | right.header)) }
it { should eql(Relation.new(left.header | right.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down
12 changes: 6 additions & 6 deletions spec/integration/axiom/algebra/join/optimize_spec.rb
Expand Up @@ -14,9 +14,9 @@
let(:object) { described_class.new(left, right) }

context 'left is an empty relation' do
let(:left) { Relation::Empty.new(original_left.header) }
let(:left) { Relation.new(original_left.header) }

it { should eql(Relation::Empty.new(right.header)) }
it { should eql(Relation.new(right.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand All @@ -31,9 +31,9 @@
end

context 'right is an empty relation' do
let(:right) { Relation::Empty.new(original_right.header) }
let(:right) { Relation.new(original_right.header) }

it { should eql(Relation::Empty.new(right.header)) }
it { should eql(Relation.new(right.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand All @@ -50,7 +50,7 @@
context 'left is an empty relation when optimized' do
let(:left) { Algebra::Restriction.new(original_left, Function::Proposition::Contradiction.instance) }

it { should eql(Relation::Empty.new(right.header)) }
it { should eql(Relation.new(right.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand All @@ -67,7 +67,7 @@
context 'right is an empty relation when optimized' do
let(:right) { Algebra::Restriction.new(original_right, Function::Proposition::Contradiction.instance) }

it { should eql(Relation::Empty.new(right.header)) }
it { should eql(Relation.new(right.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down
8 changes: 4 additions & 4 deletions spec/integration/axiom/algebra/product/optimize_spec.rb
Expand Up @@ -14,7 +14,7 @@
context 'left is a TABLE_DUM' do
let(:left) { TABLE_DUM }

it { should eql(Relation::Empty.new(right.header)) }
it { should eql(Relation.new(right.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand All @@ -31,7 +31,7 @@
context 'right is a TABLE_DUM' do
let(:right) { TABLE_DUM }

it { should eql(Relation::Empty.new(left.header)) }
it { should eql(Relation.new(left.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand All @@ -48,7 +48,7 @@
context 'left is a TABLE_DUM when optimized' do
let(:left) { TABLE_DUM.project([]) }

it { should eql(Relation::Empty.new(right.header)) }
it { should eql(Relation.new(right.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand All @@ -65,7 +65,7 @@
context 'right is a TABLE_DUM when optimized' do
let(:right) { TABLE_DUM.project([]) }

it { should eql(Relation::Empty.new(left.header)) }
it { should eql(Relation.new(left.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down
8 changes: 4 additions & 4 deletions spec/integration/axiom/algebra/projection/optimize_spec.rb
Expand Up @@ -62,10 +62,10 @@
end

context 'containing an empty relation' do
let(:operand) { Relation::Empty.new(header) }
let(:attributes) { [:id] }
let(:operand) { Relation.new(header) }
let(:attributes) { [:id] }

it { should eql(Relation::Empty.new(object.header)) }
it { should eql(Relation.new(object.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand All @@ -78,7 +78,7 @@
let(:operand) { Algebra::Restriction.new(relation, Function::Proposition::Contradiction.instance) }
let(:attributes) { [:id] }

it { should eql(Relation::Empty.new(object.header)) }
it { should eql(Relation.new(object.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/axiom/algebra/rename/optimize_spec.rb
Expand Up @@ -23,9 +23,9 @@
end

context 'containing an empty relation' do
let(:operand) { Relation::Empty.new(relation.header) }
let(:operand) { Relation.new(relation.header) }

it { should eql(Relation::Empty.new(object.header)) }
it { should eql(Relation.new(object.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/axiom/algebra/restriction/optimize_spec.rb
Expand Up @@ -25,7 +25,7 @@
context 'with a contradiction' do
let(:predicate) { Function::Proposition::Contradiction.instance }

it { should eql(Relation::Empty.new(relation.header)) }
it { should eql(Relation.new(relation.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down Expand Up @@ -121,7 +121,7 @@
let(:operand) { described_class.new(relation, Function::Proposition::Contradiction.instance) }
let(:predicate) { operand[:id].gte(1) }

it { should eql(Relation::Empty.new(relation.header)) }
it { should eql(Relation.new(relation.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down
Expand Up @@ -33,7 +33,7 @@
context 'when the summarize_per is empty' do
let(:summarize_per) { relation.project([:id]).restrict { false } }

it { should eql(Relation::Empty.new(object.header)) }
it { should eql(Relation.new(object.header)) }

it 'returns an equivalent relation to the unoptimized operation' do
should == object
Expand Down
8 changes: 4 additions & 4 deletions spec/integration/axiom/algebra/union/optimize_spec.rb
Expand Up @@ -19,8 +19,8 @@
end

context 'left is an empty relation' do
let(:left) { Relation::Empty.new(header) }
let(:right) { original_right }
let(:left) { Relation.new(header) }
let(:right) { original_right }

it { should be(right) }

Expand All @@ -42,8 +42,8 @@
end

context 'right is an empty relation' do
let(:left) { original_left }
let(:right) { Relation::Empty.new(header) }
let(:left) { original_left }
let(:right) { Relation.new(header) }

it { should be(left) }

Expand Down
Expand Up @@ -10,7 +10,7 @@
context 'with an empty Array' do
let(:body) { [] }

it { should eql(Relation::Empty.new(object.header)) }
it { should eql(Relation.new(object.header)) }

it 'returns an equivalent object to the unoptimized operation' do
should == object
Expand Down
Expand Up @@ -6,7 +6,7 @@
subject { object.optimize }

let(:header) { Relation::Header.coerce([[:id, Integer]]) }
let(:left) { Relation::Empty.new(header) }
let(:left) { Relation.new(header) }
let(:right) { Relation.new(header, LazyEnumerable.new([[1]])) }
let(:relation) { left.difference(right) }
let(:object) { described_class.new(relation) }
Expand Down
Expand Up @@ -7,7 +7,7 @@

let(:header) { Relation::Header.coerce([[:id, Integer]]) }
let(:left) { Relation.new(header, LazyEnumerable.new([[1]])) }
let(:right) { Relation::Empty.new(header) }
let(:right) { Relation.new(header) }
let(:relation) { left.difference(right) }
let(:object) { described_class.new(relation) }

Expand Down
Expand Up @@ -6,7 +6,7 @@
subject { object.optimize }

let(:header) { Relation::Header.coerce([[:id, Integer]]) }
let(:left) { Relation::Empty.new(header) }
let(:left) { Relation.new(header) }
let(:right) { Relation.new(header, LazyEnumerable.new([[1]])) }
let(:relation) { left.intersect(right) }
let(:object) { described_class.new(relation) }
Expand Down
Expand Up @@ -7,7 +7,7 @@

let(:header) { Relation::Header.coerce([[:id, Integer]]) }
let(:left) { Relation.new(header, LazyEnumerable.new([[1]])) }
let(:right) { Relation::Empty.new(header) }
let(:right) { Relation.new(header) }
let(:relation) { left.intersect(right) }
let(:object) { described_class.new(relation) }

Expand Down
Expand Up @@ -18,7 +18,7 @@

it { should be_kind_of(Algebra::Join) }

its(:left) { should eql(Relation::Empty.new(left.header)) }
its(:left) { should eql(Relation.new(left.header)) }

its(:right) { should eql(right.restrict { Function::Proposition::Contradiction.instance }) }
end
Expand Down
Expand Up @@ -20,7 +20,7 @@

its(:left) { should eql(left.restrict { Function::Proposition::Contradiction.instance }) }

its(:right) { should eql(Relation::Empty.new(right.header)) }
its(:right) { should eql(Relation.new(right.header)) }
end

context 'with one joined tuple' do
Expand Down
Expand Up @@ -14,7 +14,7 @@
end

context 'when the operand is empty' do
let(:operand) { Relation::Empty.new(header) }
let(:operand) { Relation.new(header) }

it { should be(true) }
end
Expand Down
Expand Up @@ -6,7 +6,7 @@
subject { object.optimize }

let(:header) { Relation::Header.coerce([[:id, Integer], [:name, String]]) }
let(:base) { Relation::Empty.new(header) }
let(:base) { Relation.new(header) }
let(:relation) { base.project([:id]) }
let(:object) { described_class.new(relation) }

Expand Down
Expand Up @@ -14,7 +14,7 @@
end

context 'when the operand is an empty relation' do
let(:operand) { Relation::Empty.new(header) }
let(:operand) { Relation.new(header) }

it { should be(true) }
end
Expand Down
Expand Up @@ -6,7 +6,7 @@
subject { object.optimize }

let(:header) { Relation::Header.coerce([[:id, Integer]]) }
let(:left) { Relation::Empty.new(header) }
let(:left) { Relation.new(header) }
let(:right) { Relation.new(header, LazyEnumerable.new([[2]])) }
let(:relation) { left.union(right) }
let(:object) { described_class.new(relation) }
Expand Down
Expand Up @@ -7,7 +7,7 @@

let(:header) { Relation::Header.coerce([[:id, Integer]]) }
let(:left) { Relation.new(header, LazyEnumerable.new([[1]])) }
let(:right) { Relation::Empty.new(header) }
let(:right) { Relation.new(header) }
let(:relation) { left.union(right) }
let(:object) { described_class.new(relation) }

Expand Down

0 comments on commit 7e482dc

Please sign in to comment.