cql 0.2.1 → 0.3.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 +15 -0
- data/lib/cql.rb +71 -63
- data/lib/dsl.rb +110 -110
- data/lib/feature_filters.rb +88 -72
- data/lib/map_reduce.rb +104 -40
- data/lib/sso_filters.rb +81 -72
- data/spec/filter_feature_dsl_spec.rb +284 -486
- data/spec/filter_sso_spec.rb +161 -288
- data/spec/line_count_filterable_specs.rb +73 -0
- data/spec/line_filterable_specs.rb +40 -0
- data/spec/map_reduce_spec.rb +132 -132
- data/spec/multiple_queries_spec.rb +27 -0
- data/spec/name_filterable_specs.rb +40 -0
- data/spec/select_feature_dsl_spec.rb +191 -50
- data/spec/select_scen_outline_dsl_spec.rb +323 -126
- data/spec/select_scenario_dsl_spec.rb +197 -73
- data/spec/spec_helper.rb +27 -0
- data/spec/tag_filterable_specs.rb +106 -0
- metadata +54 -37
- data/spec/unit_spec.rb +0 -22
data/spec/filter_sso_spec.rb
CHANGED
@@ -1,288 +1,161 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
end
|
137
|
-
|
138
|
-
{
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
1=>[{"name"=> "1 line"}, {"name"=> "2 lines"}, {"name"=> "3 lines"}, {"name"=> "4 lines"}],
|
163
|
-
2=>[{"name"=> "2 lines"}, {"name"=> "3 lines"}, {"name"=> "4 lines"}],
|
164
|
-
3=>[{"name"=> "3 lines"}, {"name"=> "4 lines"}],
|
165
|
-
4=>{"name"=> "4 lines"},
|
166
|
-
5 =>[]
|
167
|
-
|
168
|
-
|
169
|
-
}.each do |number, expected|
|
170
|
-
it "should filter scenarios by the number of lines with the 'lc_gte' operator for count of #{number}" do
|
171
|
-
gs = CQL::Repository.new File.dirname(__FILE__) + "/../fixtures/features/scenario/line_count"
|
172
|
-
|
173
|
-
result = gs.query do
|
174
|
-
select name
|
175
|
-
from scenarios
|
176
|
-
with lc gte number
|
177
|
-
end
|
178
|
-
|
179
|
-
result.should == expected
|
180
|
-
end
|
181
|
-
end
|
182
|
-
|
183
|
-
|
184
|
-
end
|
185
|
-
|
186
|
-
describe 'exact line match' do
|
187
|
-
it 'should filter based on an exact line' do
|
188
|
-
gs = CQL::Repository.new File.dirname(__FILE__) + "/../fixtures/features/scenario/line_filter"
|
189
|
-
|
190
|
-
result = gs.query do
|
191
|
-
select name
|
192
|
-
from scenarios
|
193
|
-
with line 'green eggs and ham'
|
194
|
-
end
|
195
|
-
|
196
|
-
result.size.should == 1
|
197
|
-
|
198
|
-
end
|
199
|
-
|
200
|
-
it 'should filter all results when the exact line given does not match' do
|
201
|
-
gs = CQL::Repository.new File.dirname(__FILE__) + "/../fixtures/features/scenario/line_filter"
|
202
|
-
|
203
|
-
result = gs.query do
|
204
|
-
select name
|
205
|
-
from scenarios
|
206
|
-
with line 'no match'
|
207
|
-
end
|
208
|
-
|
209
|
-
result.size.should == 0
|
210
|
-
|
211
|
-
end
|
212
|
-
|
213
|
-
it 'should filter no results when the exact line given is present in all scenarios' do
|
214
|
-
gs = CQL::Repository.new File.dirname(__FILE__) + "/../fixtures/features/scenario/line_filter"
|
215
|
-
|
216
|
-
result = gs.query do
|
217
|
-
select name
|
218
|
-
from scenarios
|
219
|
-
with line 'a cat in a hat'
|
220
|
-
end
|
221
|
-
|
222
|
-
result.size.should == 2
|
223
|
-
|
224
|
-
end
|
225
|
-
end
|
226
|
-
|
227
|
-
describe 'exact line match' do
|
228
|
-
it 'should filter based on a regexp match' do
|
229
|
-
gs = CQL::Repository.new File.dirname(__FILE__) + "/../fixtures/features/scenario/line_filter"
|
230
|
-
|
231
|
-
result = gs.query do
|
232
|
-
select name
|
233
|
-
from scenarios
|
234
|
-
with line /green/
|
235
|
-
end
|
236
|
-
|
237
|
-
result.size.should == 1
|
238
|
-
|
239
|
-
end
|
240
|
-
|
241
|
-
it 'should filter all if no regexp match' do
|
242
|
-
gs = CQL::Repository.new File.dirname(__FILE__) + "/../fixtures/features/scenario/line_filter"
|
243
|
-
|
244
|
-
result = gs.query do
|
245
|
-
select name
|
246
|
-
from scenarios
|
247
|
-
with line /will not be found/
|
248
|
-
end
|
249
|
-
|
250
|
-
result.size.should == 0
|
251
|
-
|
252
|
-
end
|
253
|
-
|
254
|
-
it 'should filter none if all match regexp' do
|
255
|
-
repo = CQL::Repository.new File.dirname(__FILE__) + "/../fixtures/features/scenario/line_filter"
|
256
|
-
|
257
|
-
result = repo.query do
|
258
|
-
select name
|
259
|
-
from scenarios
|
260
|
-
with line /cat/
|
261
|
-
end
|
262
|
-
|
263
|
-
result.size.should == 2
|
264
|
-
|
265
|
-
end
|
266
|
-
|
267
|
-
end
|
268
|
-
|
269
|
-
describe 'tag search' do
|
270
|
-
it 'should return scenarios with matching tags' do
|
271
|
-
repo = CQL::Repository.new File.dirname(__FILE__) + "/../fixtures/features/scenario/tags"
|
272
|
-
|
273
|
-
result = repo.query do
|
274
|
-
select name
|
275
|
-
from scenarios
|
276
|
-
with tags '@one'
|
277
|
-
end
|
278
|
-
|
279
|
-
result.should == [{'name'=>'Next'},{'name'=>'Another'}]
|
280
|
-
end
|
281
|
-
end
|
282
|
-
|
283
|
-
# Has tag
|
284
|
-
# Name
|
285
|
-
# Name match
|
286
|
-
|
287
|
-
# Example count
|
288
|
-
end
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "scenario and outline filters (with)" do
|
4
|
+
|
5
|
+
|
6
|
+
# todo - seems like this kind of filtering should be available at the scenario level as well as the feature level
|
7
|
+
#it_behaves_like 'a name filterable target set', 'scenarios', {:exact_name => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/name_filter",
|
8
|
+
# :expected_results => {'name1' => [{"name" => "name1"}]}},
|
9
|
+
# :regexp => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/name_filter",
|
10
|
+
# :expected_results => {/name/ => [{"name" => "name1"},{"name" => "name2"},{"name" => "name3"}],
|
11
|
+
# /name1/ => [{"name" => "name1"}]}}
|
12
|
+
#}
|
13
|
+
|
14
|
+
it_behaves_like 'a tag filterable target set', 'scenarios', {:single_tag => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/tags",
|
15
|
+
:expected_results => {'@one' => [{'name' => 'Next'}, {'name' => 'Another'}]}},
|
16
|
+
|
17
|
+
:multiple_tags => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/tags2",
|
18
|
+
:expected_results => {['@one', '@five'] => [{'name' => 'Next'}]}},
|
19
|
+
|
20
|
+
:tc_lt => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/tag_count",
|
21
|
+
:expected_results => {0 => [],
|
22
|
+
1 => [],
|
23
|
+
2 => [{"name" => "1 tag"}],
|
24
|
+
3 => [{"name" => "1 tag"}, {"name" => "2 tags"}],
|
25
|
+
4 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}],
|
26
|
+
5 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}]}},
|
27
|
+
|
28
|
+
:tc_lte => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/tag_count",
|
29
|
+
:expected_results => {0 => [],
|
30
|
+
1 => [{"name" => "1 tag"}],
|
31
|
+
2 => [{"name" => "1 tag"}, {"name" => "2 tags"}],
|
32
|
+
3 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}],
|
33
|
+
4 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
34
|
+
5 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}]}},
|
35
|
+
|
36
|
+
:tc_gt => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/tag_count",
|
37
|
+
:expected_results => {0 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
38
|
+
1 => [{"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
39
|
+
2 => [{"name" => "3 tags"}, {"name" => "4 tags"}],
|
40
|
+
3 => [{"name" => "4 tags"}],
|
41
|
+
4 => []}},
|
42
|
+
|
43
|
+
:tc_gte => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/tag_count",
|
44
|
+
:expected_results => {0 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
45
|
+
1 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
46
|
+
2 => [{"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
47
|
+
3 => [{"name" => "3 tags"}, {"name" => "4 tags"}],
|
48
|
+
4 => [{"name" => "4 tags"}],
|
49
|
+
5 => []}}
|
50
|
+
}
|
51
|
+
|
52
|
+
it_behaves_like 'a tag filterable target set', 'scenario_outlines', {:single_tag => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scen_outlines/filters/tags",
|
53
|
+
:expected_results => {'@one' => [{'name' => 'Next'}, {'name' => 'Another'}]}},
|
54
|
+
|
55
|
+
:multiple_tags => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scen_outlines/filters/tags2",
|
56
|
+
:expected_results => {['@one', '@five'] => [{'name' => 'Next'}]}},
|
57
|
+
|
58
|
+
:tc_lt => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scen_outlines/filters/tag_count",
|
59
|
+
:expected_results => {0 => [],
|
60
|
+
1 => [],
|
61
|
+
2 => [{"name" => "1 tag"}],
|
62
|
+
3 => [{"name" => "1 tag"}, {"name" => "2 tags"}],
|
63
|
+
4 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}],
|
64
|
+
5 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}]}},
|
65
|
+
|
66
|
+
:tc_lte => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scen_outlines/filters/tag_count",
|
67
|
+
:expected_results => {0 => [],
|
68
|
+
1 => [{"name" => "1 tag"}],
|
69
|
+
2 => [{"name" => "1 tag"}, {"name" => "2 tags"}],
|
70
|
+
3 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}],
|
71
|
+
4 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
72
|
+
5 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}]}},
|
73
|
+
|
74
|
+
:tc_gt => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scen_outlines/filters/tag_count",
|
75
|
+
:expected_results => {0 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
76
|
+
1 => [{"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
77
|
+
2 => [{"name" => "3 tags"}, {"name" => "4 tags"}],
|
78
|
+
3 => [{"name" => "4 tags"}],
|
79
|
+
4 => []}},
|
80
|
+
|
81
|
+
:tc_gte => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scen_outlines/filters/tag_count",
|
82
|
+
:expected_results => {0 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
83
|
+
1 => [{"name" => "1 tag"}, {"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
84
|
+
2 => [{"name" => "2 tags"}, {"name" => "3 tags"}, {"name" => "4 tags"}],
|
85
|
+
3 => [{"name" => "3 tags"}, {"name" => "4 tags"}],
|
86
|
+
4 => [{"name" => "4 tags"}],
|
87
|
+
5 => []}}
|
88
|
+
}
|
89
|
+
|
90
|
+
it_behaves_like 'a line count filterable target set', 'scenarios', {:lc_lt => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/line_count",
|
91
|
+
:expected_results => {0 => [],
|
92
|
+
1 => [],
|
93
|
+
2 => [{"name" => "1 line"}],
|
94
|
+
3 => [{"name" => "1 line"}, {"name" => "2 lines"}],
|
95
|
+
4 => [{"name" => "1 line"}, {"name" => "2 lines"}, {"name" => "3 lines"}],
|
96
|
+
5 => [{"name" => "1 line"}, {"name" => "2 lines"}, {"name" => "3 lines"}, {"name" => "4 lines"}]}},
|
97
|
+
:lc_lte => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/line_count",
|
98
|
+
:expected_results => {0 => [],
|
99
|
+
1 => [{"name" => "1 line"}],
|
100
|
+
2 => [{"name" => "1 line"}, {"name" => "2 lines"}],
|
101
|
+
3 => [{"name" => "1 line"}, {"name" => "2 lines"}, {"name" => "3 lines"}],
|
102
|
+
4 => [{"name" => "1 line"}, {"name" => "2 lines"}, {"name" => "3 lines"}, {"name" => "4 lines"}],
|
103
|
+
5 => [{"name" => "1 line"}, {"name" => "2 lines"}, {"name" => "3 lines"}, {"name" => "4 lines"}]}},
|
104
|
+
:lc_gt => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/line_count",
|
105
|
+
:expected_results => {0 => [{"name" => "1 line"}, {"name" => "2 lines"}, {"name" => "3 lines"}, {"name" => "4 lines"}],
|
106
|
+
1 => [{"name" => "2 lines"}, {"name" => "3 lines"}, {"name" => "4 lines"}],
|
107
|
+
2 => [{"name" => "3 lines"}, {"name" => "4 lines"}],
|
108
|
+
3 => [{"name" => "4 lines"}],
|
109
|
+
4 => []}},
|
110
|
+
:lc_gte => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/line_count",
|
111
|
+
:expected_results => {0 => [{"name" => "1 line"}, {"name" => "2 lines"}, {"name" => "3 lines"}, {"name" => "4 lines"}],
|
112
|
+
1 => [{"name" => "1 line"}, {"name" => "2 lines"}, {"name" => "3 lines"}, {"name" => "4 lines"}],
|
113
|
+
2 => [{"name" => "2 lines"}, {"name" => "3 lines"}, {"name" => "4 lines"}],
|
114
|
+
3 => [{"name" => "3 lines"}, {"name" => "4 lines"}],
|
115
|
+
4 => [{"name" => "4 lines"}],
|
116
|
+
5 => []}}}
|
117
|
+
|
118
|
+
|
119
|
+
it_behaves_like 'a line filterable target set', 'scenarios', {:exact_line => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/line_filter",
|
120
|
+
:expected_results => {'all match' => [{"name" => "sc1"}, {"name" => "sc2"}],
|
121
|
+
'green eggs and ham' => [{"name" => "sc1"}],
|
122
|
+
'no match' => []}},
|
123
|
+
:regexp => {:fixture_location => "#{CQL_FEATURE_FIXTURES_DIRECTORY}/scenario/line_filter",
|
124
|
+
:expected_results => {/all/ => [{"name" => "sc1"}, {"name" => "sc2"}],
|
125
|
+
/green/ => [{"name" => "sc1"}],
|
126
|
+
/will not be found/ => []}}}
|
127
|
+
|
128
|
+
it 'should filter by multiple filters' do
|
129
|
+
gs = CQL::Repository.new("#{@feature_fixtures_directory}/scenario/tag_count")
|
130
|
+
|
131
|
+
result = gs.query do
|
132
|
+
select name
|
133
|
+
from scenarios
|
134
|
+
with tc gt 1
|
135
|
+
with tc lt 3
|
136
|
+
end
|
137
|
+
|
138
|
+
expect(result).to eq([{"name" => "2 tags"}])
|
139
|
+
end
|
140
|
+
|
141
|
+
it 'should filter by multiple filters' do
|
142
|
+
gs = CQL::Repository.new("#{@feature_fixtures_directory}/scen_outlines/filters/tag_count")
|
143
|
+
|
144
|
+
result = gs.query do
|
145
|
+
select name
|
146
|
+
from scenario_outlines
|
147
|
+
with tc gt 1
|
148
|
+
with tc lt 3
|
149
|
+
end
|
150
|
+
|
151
|
+
expect(result).to eq([{"name" => "2 tags"}])
|
152
|
+
end
|
153
|
+
|
154
|
+
#todo - add line filter tests for scenario outlines
|
155
|
+
#todo - add line count filter tests for scenario outlines
|
156
|
+
|
157
|
+
# # Name
|
158
|
+
# # Name match
|
159
|
+
#
|
160
|
+
# # Example count
|
161
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
shared_examples_for 'a line count filterable target set' do |target_type, test_data|
|
4
|
+
|
5
|
+
describe 'line count filters' do
|
6
|
+
|
7
|
+
|
8
|
+
it "should filter based on 'lc lt'" do
|
9
|
+
gs = CQL::Repository.new(test_data[:lc_lt][:fixture_location])
|
10
|
+
|
11
|
+
expected_results = test_data[:lc_lt][:expected_results]
|
12
|
+
|
13
|
+
expected_results.each do |number, expected|
|
14
|
+
result = gs.query do
|
15
|
+
select name
|
16
|
+
from target_type
|
17
|
+
with lc lt number
|
18
|
+
end
|
19
|
+
|
20
|
+
expect(result).to eq(expected)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should filter based on 'lc_lte'" do
|
25
|
+
gs = CQL::Repository.new(test_data[:lc_lte][:fixture_location])
|
26
|
+
|
27
|
+
expected_results = test_data[:lc_lte][:expected_results]
|
28
|
+
|
29
|
+
expected_results.each do |number, expected|
|
30
|
+
result = gs.query do
|
31
|
+
select name
|
32
|
+
from target_type
|
33
|
+
with lc lte number
|
34
|
+
end
|
35
|
+
|
36
|
+
expect(result).to eq(expected)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should filter based on 'lc_gt'" do
|
41
|
+
gs = CQL::Repository.new(test_data[:lc_gt][:fixture_location])
|
42
|
+
|
43
|
+
expected_results = test_data[:lc_gt][:expected_results]
|
44
|
+
|
45
|
+
expected_results.each do |number, expected|
|
46
|
+
result = gs.query do
|
47
|
+
select name
|
48
|
+
from target_type
|
49
|
+
with lc gt number
|
50
|
+
end
|
51
|
+
|
52
|
+
expect(result).to eq(expected)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should filter based on 'lc_gte'" do
|
57
|
+
gs = CQL::Repository.new(test_data[:lc_gte][:fixture_location])
|
58
|
+
|
59
|
+
expected_results = test_data[:lc_gte][:expected_results]
|
60
|
+
|
61
|
+
expected_results.each do |number, expected|
|
62
|
+
result = gs.query do
|
63
|
+
select name
|
64
|
+
from target_type
|
65
|
+
with lc gte number
|
66
|
+
end
|
67
|
+
|
68
|
+
expect(result).to eq(expected)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|