axiom-optimizer 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +2 -1
- data/.rubocop.yml +6 -0
- data/.travis.yml +16 -20
- data/CONTRIBUTING.md +1 -2
- data/Gemfile +3 -1
- data/Gemfile.devtools +28 -18
- data/README.md +7 -13
- data/TODO +6 -5
- data/axiom-optimizer.gemspec +3 -3
- data/config/flay.yml +1 -1
- data/config/reek.yml +5 -29
- data/config/rubocop.yml +16 -10
- data/lib/axiom/optimizer.rb +3 -7
- data/lib/axiom/optimizer/algebra/difference.rb +2 -2
- data/lib/axiom/optimizer/algebra/extension.rb +6 -6
- data/lib/axiom/optimizer/algebra/intersection.rb +2 -2
- data/lib/axiom/optimizer/algebra/join.rb +4 -4
- data/lib/axiom/optimizer/algebra/product.rb +4 -4
- data/lib/axiom/optimizer/algebra/projection.rb +5 -5
- data/lib/axiom/optimizer/algebra/rename.rb +10 -10
- data/lib/axiom/optimizer/algebra/restriction.rb +8 -9
- data/lib/axiom/optimizer/algebra/summarization.rb +7 -7
- data/lib/axiom/optimizer/algebra/union.rb +2 -2
- data/lib/axiom/optimizer/function.rb +4 -6
- data/lib/axiom/optimizer/function/binary.rb +2 -2
- data/lib/axiom/optimizer/function/connective/binary.rb +1 -1
- data/lib/axiom/optimizer/function/connective/negation.rb +1 -1
- data/lib/axiom/optimizer/function/predicate.rb +1 -1
- data/lib/axiom/optimizer/function/predicate/comparable.rb +8 -6
- data/lib/axiom/optimizer/function/predicate/enumerable.rb +2 -2
- data/lib/axiom/optimizer/function/unary.rb +1 -1
- data/lib/axiom/optimizer/relation/operation/binary.rb +12 -12
- data/lib/axiom/optimizer/relation/operation/reverse.rb +9 -9
- data/lib/axiom/optimizer/relation/operation/{order.rb → sorted.rb} +15 -15
- data/lib/axiom/optimizer/relation/operation/unary.rb +7 -7
- data/lib/axiom/optimizer/support/predicate_partition.rb +11 -13
- data/lib/axiom/optimizer/version.rb +1 -1
- data/spec/integration/axiom/algebra/difference/optimize_spec.rb +12 -12
- data/spec/integration/axiom/algebra/intersection/optimize_spec.rb +12 -12
- data/spec/integration/axiom/algebra/join/optimize_spec.rb +6 -6
- data/spec/integration/axiom/algebra/product/optimize_spec.rb +10 -10
- data/spec/integration/axiom/algebra/projection/optimize_spec.rb +14 -14
- data/spec/integration/axiom/algebra/rename/optimize_spec.rb +38 -38
- data/spec/integration/axiom/algebra/restriction/optimize_spec.rb +12 -12
- data/spec/integration/axiom/algebra/summarization/optimize_spec.rb +2 -2
- data/spec/integration/axiom/algebra/union/optimize_spec.rb +16 -16
- data/spec/integration/axiom/function/optimize_spec.rb +1 -1
- data/spec/integration/axiom/relation/operation/limit/optimize_spec.rb +20 -20
- data/spec/integration/axiom/relation/operation/offset/optimize_spec.rb +14 -14
- data/spec/integration/axiom/relation/operation/reverse/optimize_spec.rb +15 -15
- data/spec/integration/axiom/relation/operation/{order → sorted}/optimize_spec.rb +6 -6
- data/spec/integration/axiom/relation/optimize_spec.rb +1 -1
- data/spec/shared/function_connective_binary_optimize_behavior.rb +8 -2
- data/spec/shared/optimize_method_behavior.rb +0 -11
- data/spec/spec_helper.rb +9 -9
- data/spec/support/config_alias.rb +2 -0
- data/spec/unit/axiom/optimizer/algebra/extension/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/algebra/extension/{order_operand → sorted_operand}/optimize_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/algebra/rename/limit_operand/optimize_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/algebra/rename/offset_operand/optimize_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/algebra/rename/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/algebra/rename/{order_operand → sorted_operand}/optimize_spec.rb +2 -2
- data/spec/unit/axiom/optimizer/algebra/restriction/combination_operand/optimize_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/algebra/restriction/predicate_spec.rb +5 -4
- data/spec/unit/axiom/optimizer/algebra/restriction/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/algebra/restriction/{order_operand → sorted_operand}/optimize_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/algebra/summarization/empty_operand/class_methods/extension_default_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/algebra/summarization/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/algebra/summarization/{order_operand → sorted_operand}/optimize_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/algebra/summarization/summarize_per_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/function/binary/constant_operands/optimizable_predicate_spec.rb +4 -4
- data/spec/unit/axiom/optimizer/function/connective/conjunction/contradiction/optimizable_predicate_spec.rb +2 -2
- data/spec/unit/axiom/optimizer/function/connective/disjunction/tautology/optimizable_predicate_spec.rb +2 -2
- data/spec/unit/axiom/optimizer/function/unary/constant_operand/optimizable_predicate_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/function/util/class_methods/max_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/function/util/class_methods/min_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/optimizable/optimize_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/optimizable_predicate_spec.rb +1 -5
- data/spec/unit/axiom/optimizer/optimize_spec.rb +1 -5
- data/spec/unit/axiom/optimizer/relation/operation/binary/{order_left → sorted_left}/optimizable_predicate_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/relation/operation/binary/{order_left → sorted_left}/optimize_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/relation/operation/binary/{order_right → sorted_right}/optimizable_predicate_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/relation/operation/binary/{order_right → sorted_right}/optimize_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/relation/operation/limit/equal_limit_operand/optimize_spec.rb +2 -2
- data/spec/unit/axiom/optimizer/relation/operation/limit/limit_operand/optimize_spec.rb +4 -4
- data/spec/unit/axiom/optimizer/relation/operation/limit/unoptimized_operand/optimize_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/relation/operation/limit/zero_limit/optimize_spec.rb +2 -2
- data/spec/unit/axiom/optimizer/relation/operation/offset/offset_operand/optimize_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/relation/operation/offset/unoptimized_operand/optimize_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/relation/operation/offset/zero_offset/optimize_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/relation/operation/reverse/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +3 -3
- data/spec/unit/axiom/optimizer/relation/operation/reverse/{order_operand → sorted_operand}/optimize_spec.rb +2 -2
- data/spec/unit/axiom/optimizer/relation/operation/reverse/unoptimized_operand/optimize_spec.rb +4 -4
- data/spec/unit/axiom/optimizer/relation/operation/{order → sorted}/one_limit_operand/optimizable_predicate_spec.rb +2 -2
- data/spec/unit/axiom/optimizer/relation/operation/{order → sorted}/one_limit_operand/optimize_spec.rb +1 -1
- data/spec/unit/axiom/optimizer/relation/operation/{order/order_operand → sorted/sorted_operand}/optimizable_predicate_spec.rb +4 -4
- data/spec/unit/axiom/optimizer/relation/operation/{order/order_operand → sorted/sorted_operand}/optimize_spec.rb +5 -5
- data/spec/unit/axiom/optimizer/relation/operation/{order → sorted}/unoptimized_operand/optimizable_predicate_spec.rb +2 -2
- data/spec/unit/axiom/optimizer/relation/operation/{order → sorted}/unoptimized_operand/optimize_spec.rb +2 -2
- data/spec/unit/axiom/optimizer/relation/operation/unary/{order_operand → sorted_operand}/optimizable_predicate_spec.rb +4 -4
- data/spec/unit/axiom/optimizer/relation/operation/unary/{order_operand → sorted_operand}/optimize_spec.rb +2 -2
- metadata +291 -47
- data/spec/support/ice_nine_config.rb +0 -6
@@ -6,7 +6,7 @@ module Axiom
|
|
6
6
|
module Operation
|
7
7
|
|
8
8
|
# Abstract base class representing Reverse optimizations
|
9
|
-
class Reverse <
|
9
|
+
class Reverse < Sorted
|
10
10
|
|
11
11
|
# Optimize when the operand is a Reverse
|
12
12
|
class ReverseOperand < self
|
@@ -31,28 +31,28 @@ module Axiom
|
|
31
31
|
|
32
32
|
end # class ReverseOperand
|
33
33
|
|
34
|
-
# Optimize when the operand is an
|
35
|
-
class
|
34
|
+
# Optimize when the operand is an Sorted
|
35
|
+
class SortedOperand < self
|
36
36
|
|
37
|
-
# Test if the operand is an
|
37
|
+
# Test if the operand is an Sorted
|
38
38
|
#
|
39
39
|
# @return [Boolean]
|
40
40
|
#
|
41
41
|
# @api private
|
42
42
|
def optimizable?
|
43
|
-
operand.kind_of?(Axiom::Relation::Operation::
|
43
|
+
operand.kind_of?(Axiom::Relation::Operation::Sorted)
|
44
44
|
end
|
45
45
|
|
46
|
-
# Flatten Reverse operation and
|
46
|
+
# Flatten Reverse operation and Sorted operand into an Sorted
|
47
47
|
#
|
48
|
-
# @return [
|
48
|
+
# @return [Sorted]
|
49
49
|
#
|
50
50
|
# @api private
|
51
51
|
def optimize
|
52
52
|
operand.operand.sort_by { operation.directions }
|
53
53
|
end
|
54
54
|
|
55
|
-
end # class
|
55
|
+
end # class SortedOperand
|
56
56
|
|
57
57
|
# Optimize when operand is optimizable
|
58
58
|
class UnoptimizedOperand < self
|
@@ -71,7 +71,7 @@ module Axiom
|
|
71
71
|
|
72
72
|
Axiom::Relation::Operation::Reverse.optimizer = chain(
|
73
73
|
ReverseOperand,
|
74
|
-
|
74
|
+
SortedOperand,
|
75
75
|
OneLimitOperand,
|
76
76
|
EmptyOperand,
|
77
77
|
MaterializedOperand,
|
@@ -5,13 +5,13 @@ module Axiom
|
|
5
5
|
module Relation
|
6
6
|
module Operation
|
7
7
|
|
8
|
-
# Abstract base class representing
|
9
|
-
class
|
8
|
+
# Abstract base class representing Sorted optimizations
|
9
|
+
class Sorted < Unary
|
10
10
|
|
11
|
-
# Optimize when the operand is an
|
12
|
-
class
|
11
|
+
# Optimize when the operand is an Sorted
|
12
|
+
class SortedOperand < self
|
13
13
|
|
14
|
-
# Test if the operand is an
|
14
|
+
# Test if the operand is an Sorted
|
15
15
|
#
|
16
16
|
# @return [Boolean]
|
17
17
|
#
|
@@ -20,16 +20,16 @@ module Axiom
|
|
20
20
|
operand.kind_of?(operation.class)
|
21
21
|
end
|
22
22
|
|
23
|
-
# Flatten
|
23
|
+
# Flatten Sorted operations using the operation directions
|
24
24
|
#
|
25
|
-
# @return [
|
25
|
+
# @return [Sorted]
|
26
26
|
#
|
27
27
|
# @api private
|
28
28
|
def optimize
|
29
|
-
operand.operand.sort_by
|
29
|
+
operand.operand.sort_by(operation.directions)
|
30
30
|
end
|
31
31
|
|
32
|
-
end # class
|
32
|
+
end # class SortedOperand
|
33
33
|
|
34
34
|
# Optimize when the operand is a Limit with a limit of 1
|
35
35
|
class OneLimitOperand < self
|
@@ -44,7 +44,7 @@ module Axiom
|
|
44
44
|
operand.limit == 1
|
45
45
|
end
|
46
46
|
|
47
|
-
# An
|
47
|
+
# An Sorted of a Limit with a limit of 1 is a noop
|
48
48
|
#
|
49
49
|
# @return [Limit]
|
50
50
|
#
|
@@ -59,26 +59,26 @@ module Axiom
|
|
59
59
|
class UnoptimizedOperand < self
|
60
60
|
include Function::Unary::UnoptimizedOperand
|
61
61
|
|
62
|
-
# Return an
|
62
|
+
# Return an Sorted with an optimized operand
|
63
63
|
#
|
64
64
|
# @return [Offset]
|
65
65
|
#
|
66
66
|
# @api private
|
67
67
|
def optimize
|
68
|
-
operand.sort_by
|
68
|
+
operand.sort_by(operation.directions)
|
69
69
|
end
|
70
70
|
|
71
71
|
end # class UnoptimizedOperand
|
72
72
|
|
73
|
-
Axiom::Relation::Operation::
|
74
|
-
|
73
|
+
Axiom::Relation::Operation::Sorted.optimizer = chain(
|
74
|
+
SortedOperand,
|
75
75
|
OneLimitOperand,
|
76
76
|
EmptyOperand,
|
77
77
|
MaterializedOperand,
|
78
78
|
UnoptimizedOperand
|
79
79
|
)
|
80
80
|
|
81
|
-
end # class
|
81
|
+
end # class Sorted
|
82
82
|
end # module Operation
|
83
83
|
end # module Relation
|
84
84
|
end # class Optimizer
|
@@ -26,28 +26,28 @@ module Axiom
|
|
26
26
|
@header = operation.header
|
27
27
|
end
|
28
28
|
|
29
|
-
# Optimize when the operand is an
|
30
|
-
module
|
29
|
+
# Optimize when the operand is an Sorted
|
30
|
+
module SortedOperand
|
31
31
|
|
32
|
-
# Test if the operand is an
|
32
|
+
# Test if the operand is an Sorted
|
33
33
|
#
|
34
34
|
# @return [Boolean]
|
35
35
|
#
|
36
36
|
# @api private
|
37
37
|
def optimizable?
|
38
|
-
operand.kind_of?(Axiom::Relation::Operation::
|
38
|
+
operand.kind_of?(Axiom::Relation::Operation::Sorted)
|
39
39
|
end
|
40
40
|
|
41
|
-
# Drop the
|
41
|
+
# Drop the Sorted and wrap the operand
|
42
42
|
#
|
43
|
-
# @return [
|
43
|
+
# @return [Sorted]
|
44
44
|
#
|
45
45
|
# @api private
|
46
46
|
def optimize
|
47
47
|
wrap_operand
|
48
48
|
end
|
49
49
|
|
50
|
-
end # module
|
50
|
+
end # module SortedOperand
|
51
51
|
|
52
52
|
# Optimize when the header is not changed
|
53
53
|
class UnchangedHeader < self
|
@@ -45,14 +45,12 @@ module Axiom
|
|
45
45
|
#
|
46
46
|
# @api private
|
47
47
|
def initialize(predicate, left_header, right_header)
|
48
|
-
@left
|
49
|
-
@right = TAUTOLOGY
|
50
|
-
@remainder = TAUTOLOGY
|
48
|
+
@left = @right = @remainder = TAUTOLOGY
|
51
49
|
|
52
50
|
@left_header = left_header
|
53
51
|
@right_header = right_header
|
54
52
|
|
55
|
-
partition
|
53
|
+
partition(predicate)
|
56
54
|
end
|
57
55
|
|
58
56
|
private
|
@@ -64,14 +62,14 @@ module Axiom
|
|
64
62
|
# @return [undefined]
|
65
63
|
#
|
66
64
|
# @api private
|
67
|
-
def partition
|
65
|
+
def partition(predicate)
|
68
66
|
each_operand(predicate) do |operand|
|
69
67
|
case operand
|
70
|
-
when Axiom::Function::Binary then partition_binary
|
71
|
-
when Axiom::Function::Unary then partition_unary
|
72
|
-
when Axiom::Attribute::Boolean then partition_attribute
|
68
|
+
when Axiom::Function::Binary then partition_binary(operand)
|
69
|
+
when Axiom::Function::Unary then partition_unary(operand)
|
70
|
+
when Axiom::Attribute::Boolean then partition_attribute(operand)
|
73
71
|
else
|
74
|
-
partition_proposition
|
72
|
+
partition_proposition(operand)
|
75
73
|
end
|
76
74
|
end
|
77
75
|
end
|
@@ -83,7 +81,7 @@ module Axiom
|
|
83
81
|
# @return [undefined]
|
84
82
|
#
|
85
83
|
# @api private
|
86
|
-
def partition_binary
|
84
|
+
def partition_binary(function)
|
87
85
|
operands = [function.left, function.right].grep(Axiom::Attribute)
|
88
86
|
left_operands = @left_header & operands
|
89
87
|
right_operands = @right_header & operands
|
@@ -103,7 +101,7 @@ module Axiom
|
|
103
101
|
# @return [undefined]
|
104
102
|
#
|
105
103
|
# @api private
|
106
|
-
def partition_unary
|
104
|
+
def partition_unary(function)
|
107
105
|
operand = function.operand
|
108
106
|
@left &= function if @left_header.include?(operand)
|
109
107
|
@right &= function if @right_header.include?(operand)
|
@@ -116,7 +114,7 @@ module Axiom
|
|
116
114
|
# @return [undefined]
|
117
115
|
#
|
118
116
|
# @api private
|
119
|
-
def partition_attribute
|
117
|
+
def partition_attribute(attribute)
|
120
118
|
@left &= attribute if @left_header.include?(attribute)
|
121
119
|
@right &= attribute if @right_header.include?(attribute)
|
122
120
|
end
|
@@ -128,7 +126,7 @@ module Axiom
|
|
128
126
|
# @return [undefined]
|
129
127
|
#
|
130
128
|
# @api private
|
131
|
-
def partition_proposition
|
129
|
+
def partition_proposition(proposition)
|
132
130
|
@remainder &= proposition
|
133
131
|
@left &= proposition
|
134
132
|
@right &= proposition
|
@@ -14,8 +14,8 @@ describe Algebra::Difference, '#optimize' do
|
|
14
14
|
|
15
15
|
before do
|
16
16
|
# skip dup of the left and right body to avoid clearing the method stubs
|
17
|
-
left_body.
|
18
|
-
right_body.
|
17
|
+
allow(left_body).to receive(:frozen?).and_return(true)
|
18
|
+
allow(right_body).to receive(:frozen?).and_return(true)
|
19
19
|
end
|
20
20
|
|
21
21
|
context 'left is an empty relation' do
|
@@ -29,7 +29,7 @@ describe Algebra::Difference, '#optimize' do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'does not execute right_body#each' do
|
32
|
-
right_body.
|
32
|
+
expect(right_body).not_to receive(:each)
|
33
33
|
subject
|
34
34
|
end
|
35
35
|
|
@@ -47,7 +47,7 @@ describe Algebra::Difference, '#optimize' do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'does not execute left_body#each' do
|
50
|
-
left_body.
|
50
|
+
expect(left_body).not_to receive(:each)
|
51
51
|
subject
|
52
52
|
end
|
53
53
|
|
@@ -65,12 +65,12 @@ describe Algebra::Difference, '#optimize' do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
it 'does not execute left_body#each' do
|
68
|
-
left_body.
|
68
|
+
expect(left_body).not_to receive(:each)
|
69
69
|
subject
|
70
70
|
end
|
71
71
|
|
72
72
|
it 'does not execute right_body#each' do
|
73
|
-
right_body.
|
73
|
+
expect(right_body).not_to receive(:each)
|
74
74
|
subject
|
75
75
|
end
|
76
76
|
|
@@ -88,12 +88,12 @@ describe Algebra::Difference, '#optimize' do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'does not execute left_body#each' do
|
91
|
-
left_body.
|
91
|
+
expect(left_body).not_to receive(:each)
|
92
92
|
subject
|
93
93
|
end
|
94
94
|
|
95
95
|
it 'does not execute right_body#each' do
|
96
|
-
right_body.
|
96
|
+
expect(right_body).not_to receive(:each)
|
97
97
|
subject
|
98
98
|
end
|
99
99
|
|
@@ -113,12 +113,12 @@ describe Algebra::Difference, '#optimize' do
|
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'executes left_body#each' do
|
116
|
-
left_body.
|
116
|
+
expect(left_body).to receive(:each)
|
117
117
|
subject
|
118
118
|
end
|
119
119
|
|
120
120
|
it 'executes right_body#each' do
|
121
|
-
right_body.
|
121
|
+
expect(right_body).to receive(:each)
|
122
122
|
subject
|
123
123
|
end
|
124
124
|
|
@@ -133,12 +133,12 @@ describe Algebra::Difference, '#optimize' do
|
|
133
133
|
it { should be(object) }
|
134
134
|
|
135
135
|
it 'executes left_body#each' do
|
136
|
-
left_body.
|
136
|
+
expect(left_body).to receive(:each)
|
137
137
|
subject
|
138
138
|
end
|
139
139
|
|
140
140
|
it 'executes right_body#each' do
|
141
|
-
right_body.
|
141
|
+
expect(right_body).to receive(:each)
|
142
142
|
subject
|
143
143
|
end
|
144
144
|
|
@@ -14,8 +14,8 @@ describe Algebra::Intersection, '#optimize' do
|
|
14
14
|
|
15
15
|
before do
|
16
16
|
# skip dup of the left and right body to avoid clearing the method stubs
|
17
|
-
left_body.
|
18
|
-
right_body.
|
17
|
+
allow(left_body).to receive(:frozen?).and_return(true)
|
18
|
+
allow(right_body).to receive(:frozen?).and_return(true)
|
19
19
|
end
|
20
20
|
|
21
21
|
context 'left is an empty relation' do
|
@@ -29,7 +29,7 @@ describe Algebra::Intersection, '#optimize' do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it 'does not execute right_body#each' do
|
32
|
-
right_body.
|
32
|
+
expect(right_body).not_to receive(:each)
|
33
33
|
subject
|
34
34
|
end
|
35
35
|
|
@@ -47,7 +47,7 @@ describe Algebra::Intersection, '#optimize' do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'does not execute left_body#each' do
|
50
|
-
left_body.
|
50
|
+
expect(left_body).not_to receive(:each)
|
51
51
|
subject
|
52
52
|
end
|
53
53
|
|
@@ -65,12 +65,12 @@ describe Algebra::Intersection, '#optimize' do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
it 'does not execute left_body#each' do
|
68
|
-
left_body.
|
68
|
+
expect(left_body).not_to receive(:each)
|
69
69
|
subject
|
70
70
|
end
|
71
71
|
|
72
72
|
it 'does not execute right_body#each' do
|
73
|
-
right_body.
|
73
|
+
expect(right_body).not_to receive(:each)
|
74
74
|
subject
|
75
75
|
end
|
76
76
|
|
@@ -88,12 +88,12 @@ describe Algebra::Intersection, '#optimize' do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'does not execute left_body#each' do
|
91
|
-
left_body.
|
91
|
+
expect(left_body).not_to receive(:each)
|
92
92
|
subject
|
93
93
|
end
|
94
94
|
|
95
95
|
it 'does not execute right_body#each' do
|
96
|
-
right_body.
|
96
|
+
expect(right_body).not_to receive(:each)
|
97
97
|
subject
|
98
98
|
end
|
99
99
|
|
@@ -113,12 +113,12 @@ describe Algebra::Intersection, '#optimize' do
|
|
113
113
|
end
|
114
114
|
|
115
115
|
it 'executes left_body#each' do
|
116
|
-
left_body.
|
116
|
+
expect(left_body).to receive(:each)
|
117
117
|
subject
|
118
118
|
end
|
119
119
|
|
120
120
|
it 'executes right_body#each' do
|
121
|
-
right_body.
|
121
|
+
expect(right_body).to receive(:each)
|
122
122
|
subject
|
123
123
|
end
|
124
124
|
|
@@ -133,12 +133,12 @@ describe Algebra::Intersection, '#optimize' do
|
|
133
133
|
it { should be(object) }
|
134
134
|
|
135
135
|
it 'executed left_body#each' do
|
136
|
-
left_body.
|
136
|
+
expect(left_body).to receive(:each)
|
137
137
|
subject
|
138
138
|
end
|
139
139
|
|
140
140
|
it 'executed right_body#each' do
|
141
|
-
right_body.
|
141
|
+
expect(right_body).to receive(:each)
|
142
142
|
subject
|
143
143
|
end
|
144
144
|
|
@@ -23,7 +23,7 @@ describe Algebra::Join, '#optimize' do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'does not execute right_body#each' do
|
26
|
-
right_body.
|
26
|
+
expect(right_body).not_to receive(:each)
|
27
27
|
subject
|
28
28
|
end
|
29
29
|
|
@@ -40,7 +40,7 @@ describe Algebra::Join, '#optimize' do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'does not execute left_body#each' do
|
43
|
-
left_body.
|
43
|
+
expect(left_body).not_to receive(:each)
|
44
44
|
subject
|
45
45
|
end
|
46
46
|
|
@@ -57,7 +57,7 @@ describe Algebra::Join, '#optimize' do
|
|
57
57
|
end
|
58
58
|
|
59
59
|
it 'does not execute right_body#each' do
|
60
|
-
right_body.
|
60
|
+
expect(right_body).not_to receive(:each)
|
61
61
|
subject
|
62
62
|
end
|
63
63
|
|
@@ -74,7 +74,7 @@ describe Algebra::Join, '#optimize' do
|
|
74
74
|
end
|
75
75
|
|
76
76
|
it 'does not execute left_body#each' do
|
77
|
-
left_body.
|
77
|
+
expect(left_body).not_to receive(:each)
|
78
78
|
subject
|
79
79
|
end
|
80
80
|
|
@@ -85,12 +85,12 @@ describe Algebra::Join, '#optimize' do
|
|
85
85
|
it { should be(object) }
|
86
86
|
|
87
87
|
it 'does not execute left_body#each' do
|
88
|
-
left_body.
|
88
|
+
expect(left_body).not_to receive(:each)
|
89
89
|
subject
|
90
90
|
end
|
91
91
|
|
92
92
|
it 'does not execute right_body#each' do
|
93
|
-
right_body.
|
93
|
+
expect(right_body).not_to receive(:each)
|
94
94
|
subject
|
95
95
|
end
|
96
96
|
|