remi 0.2.42 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +7 -0
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +13 -26
  5. data/README.md +1 -1
  6. data/features/step_definitions/remi_step.rb +33 -13
  7. data/features/sub_job_example.feature +24 -0
  8. data/features/sub_transform_example.feature +35 -0
  9. data/features/sub_transform_many_to_many.feature +49 -0
  10. data/features/support/env_app.rb +1 -1
  11. data/jobs/all_jobs_shared.rb +19 -16
  12. data/jobs/copy_source_job.rb +11 -9
  13. data/jobs/csv_file_target_job.rb +10 -9
  14. data/jobs/json_job.rb +18 -14
  15. data/jobs/metadata_job.rb +33 -28
  16. data/jobs/parameters_job.rb +14 -11
  17. data/jobs/sample_job.rb +106 -77
  18. data/jobs/sftp_file_target_job.rb +14 -13
  19. data/jobs/sub_job_example_job.rb +86 -0
  20. data/jobs/sub_transform_example_job.rb +43 -0
  21. data/jobs/sub_transform_many_to_many_job.rb +46 -0
  22. data/jobs/transforms/concatenate_job.rb +16 -12
  23. data/jobs/transforms/data_frame_sieve_job.rb +24 -19
  24. data/jobs/transforms/date_diff_job.rb +15 -11
  25. data/jobs/transforms/nvl_job.rb +16 -12
  26. data/jobs/transforms/parse_date_job.rb +17 -14
  27. data/jobs/transforms/partitioner_job.rb +27 -19
  28. data/jobs/transforms/prefix_job.rb +13 -10
  29. data/jobs/transforms/truncate_job.rb +14 -10
  30. data/jobs/transforms/truthy_job.rb +11 -8
  31. data/lib/remi.rb +25 -11
  32. data/lib/remi/data_frame.rb +4 -4
  33. data/lib/remi/data_frame/daru.rb +1 -37
  34. data/lib/remi/data_subject.rb +234 -48
  35. data/lib/remi/data_subjects/csv_file.rb +171 -0
  36. data/lib/remi/data_subjects/data_frame.rb +106 -0
  37. data/lib/remi/data_subjects/file_system.rb +115 -0
  38. data/lib/remi/data_subjects/local_file.rb +109 -0
  39. data/lib/remi/data_subjects/none.rb +31 -0
  40. data/lib/remi/data_subjects/postgres.rb +186 -0
  41. data/lib/remi/data_subjects/s3_file.rb +84 -0
  42. data/lib/remi/data_subjects/salesforce.rb +211 -0
  43. data/lib/remi/data_subjects/sftp_file.rb +196 -0
  44. data/lib/remi/data_subjects/sub_job.rb +50 -0
  45. data/lib/remi/dsl.rb +74 -0
  46. data/lib/remi/encoder.rb +45 -0
  47. data/lib/remi/extractor.rb +21 -0
  48. data/lib/remi/field_symbolizers.rb +1 -0
  49. data/lib/remi/job.rb +279 -113
  50. data/lib/remi/job/parameters.rb +90 -0
  51. data/lib/remi/job/sub_job.rb +35 -0
  52. data/lib/remi/job/transform.rb +165 -0
  53. data/lib/remi/loader.rb +22 -0
  54. data/lib/remi/monkeys/daru.rb +4 -0
  55. data/lib/remi/parser.rb +44 -0
  56. data/lib/remi/testing/business_rules.rb +17 -23
  57. data/lib/remi/testing/data_stub.rb +2 -2
  58. data/lib/remi/version.rb +1 -1
  59. data/remi.gemspec +3 -0
  60. data/spec/data_subject_spec.rb +475 -11
  61. data/spec/data_subjects/csv_file_spec.rb +69 -0
  62. data/spec/data_subjects/data_frame_spec.rb +52 -0
  63. data/spec/{extractor → data_subjects}/file_system_spec.rb +0 -0
  64. data/spec/{extractor → data_subjects}/local_file_spec.rb +0 -0
  65. data/spec/data_subjects/none_spec.rb +41 -0
  66. data/spec/data_subjects/postgres_spec.rb +80 -0
  67. data/spec/{extractor → data_subjects}/s3_file_spec.rb +0 -0
  68. data/spec/data_subjects/salesforce_spec.rb +117 -0
  69. data/spec/{extractor → data_subjects}/sftp_file_spec.rb +16 -0
  70. data/spec/data_subjects/sub_job_spec.rb +33 -0
  71. data/spec/encoder_spec.rb +38 -0
  72. data/spec/extractor_spec.rb +11 -0
  73. data/spec/fixtures/sf_bulk_helper_stubs.rb +443 -0
  74. data/spec/job/transform_spec.rb +257 -0
  75. data/spec/job_spec.rb +507 -0
  76. data/spec/loader_spec.rb +11 -0
  77. data/spec/parser_spec.rb +38 -0
  78. data/spec/sf_bulk_helper_spec.rb +117 -0
  79. data/spec/testing/data_stub_spec.rb +5 -3
  80. metadata +109 -27
  81. data/features/aggregate.feature +0 -42
  82. data/jobs/aggregate_job.rb +0 -31
  83. data/jobs/transforms/transform_jobs.rb +0 -4
  84. data/lib/remi/data_subject/csv_file.rb +0 -162
  85. data/lib/remi/data_subject/data_frame.rb +0 -52
  86. data/lib/remi/data_subject/postgres.rb +0 -134
  87. data/lib/remi/data_subject/salesforce.rb +0 -136
  88. data/lib/remi/data_subject/sftp_file.rb +0 -65
  89. data/lib/remi/extractor/file_system.rb +0 -92
  90. data/lib/remi/extractor/local_file.rb +0 -43
  91. data/lib/remi/extractor/s3_file.rb +0 -57
  92. data/lib/remi/extractor/sftp_file.rb +0 -83
  93. data/spec/data_subject/csv_file_spec.rb +0 -79
  94. data/spec/data_subject/data_frame.rb +0 -27
@@ -0,0 +1,11 @@
1
+ require_relative 'remi_spec'
2
+
3
+ describe Remi::Loader do
4
+ let(:loader) { Loader.new }
5
+
6
+ context '#load' do
7
+ it 'has a load method' do
8
+ expect(loader).respond_to? :load
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,38 @@
1
+ require_relative 'remi_spec'
2
+
3
+ describe Remi::Parser do
4
+ let(:field_symbolizer) { double('field_symbolizer') }
5
+ let(:context) { double('context') }
6
+ let(:fields) { double('fields') }
7
+ let(:parser) { Parser.new(context: context, fields: fields, field_symbolizer: field_symbolizer) }
8
+
9
+ context '#parse' do
10
+ it 'has a parse method' do
11
+ expect(parser).respond_to? :parse
12
+ end
13
+ end
14
+
15
+ context '#field_symbolizer' do
16
+ it 'can be set in the constructor' do
17
+ expect(parser.field_symbolizer).to eq field_symbolizer
18
+ end
19
+
20
+ it 'the field_symbolizer defined in the context takes priority' do
21
+ symbolizer_from_context = double('symbolizer_from_context')
22
+ allow(context).to receive(:field_symbolizer) { symbolizer_from_context }
23
+ expect(parser.field_symbolizer).to eq symbolizer_from_context
24
+ end
25
+ end
26
+
27
+ context '#fields' do
28
+ it 'can be set in the constructor' do
29
+ expect(parser.fields).to eq fields
30
+ end
31
+
32
+ it 'the field_symbolizer defined in the context takes priority' do
33
+ fields_from_context = double('fields_from_context')
34
+ allow(context).to receive(:fields) { fields_from_context }
35
+ expect(parser.fields).to eq fields_from_context
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,117 @@
1
+ require_relative 'remi_spec'
2
+ require 'remi/data_subjects/salesforce'
3
+ require_relative 'fixtures/sf_bulk_helper_stubs'
4
+
5
+ describe Remi::SfBulkHelper do
6
+
7
+ describe SfBulkHelper::SfBulkQuery do
8
+ before do
9
+ @sf_query = SfBulkHelper::SfBulkQuery.new({}, 'Contact', SfBulkHelperStubs.contact_query)
10
+ allow(@sf_query).to receive(:send_bulk_operation) { SfBulkHelperStubs.contact_query_raw_result }
11
+ end
12
+
13
+
14
+ describe 'info' do
15
+ it 'contains the bulk job id' do
16
+ expect(@sf_query.info['id']).to eq SfBulkHelperStubs.contact_query_raw_result['id']
17
+ end
18
+
19
+ it 'contains the query submitted' do
20
+ expect(@sf_query.info['query']).to eq SfBulkHelperStubs.contact_query
21
+ end
22
+ end
23
+
24
+ describe 'collected result' do
25
+ it 'returns the number of records specified in info' do
26
+ expect(@sf_query.result.size).to eq @sf_query.info['numberRecordsProcessed'].first.to_i
27
+ end
28
+
29
+ it 'has elements composed of hashes' do
30
+ expect(@sf_query.result.first).to be_a Hash
31
+ end
32
+
33
+ it 'has hash values that are not arrays' do
34
+ expect(@sf_query.result.first['Id']).to be_a String
35
+ end
36
+ end
37
+
38
+ describe 'as_lookup' do
39
+ it 'creates a row lookup based on a key' do
40
+ some_row = @sf_query.result[2]
41
+ expect(@sf_query.as_lookup(key: 'Id')[some_row['Id']]).to eq some_row
42
+ end
43
+
44
+ context 'with duplicates' do
45
+ before do
46
+ allow(@sf_query).to receive(:result) { SfBulkHelperStubs.contact_query_duplicated_result }
47
+ end
48
+
49
+ it 'returns the first record when duplicates are allowed' do
50
+ first_duplicated_row = @sf_query.result[0]
51
+ expect(@sf_query.as_lookup(key: 'Student_ID__c', duplicates: true)[first_duplicated_row['Student_ID__c']]).to eq first_duplicated_row
52
+ end
53
+
54
+ it 'raises an error when duplicates are not allowed' do
55
+ expect { @sf_query.as_lookup(key: 'Student_ID__c') }.to raise_error SfBulkHelper::DupeLookupKeyError
56
+ end
57
+ end
58
+ end
59
+
60
+ it 'can query for realz', skip: 'Skip live test' do
61
+ sf_client = SfConnection.new
62
+ q = SfBulkHelper::SfBulkQuery.new(sf_client.client, 'Contact', SfBulkHelperStubs.contact_query)
63
+ puts JSON.pretty_generate(q.raw_result)
64
+ end
65
+ end
66
+
67
+
68
+
69
+ describe SfBulkHelper::SfBulkUpdate do
70
+ before do
71
+ @sf_update = SfBulkHelper::SfBulkUpdate.new({}, 'Contact', SfBulkHelperStubs.contact_update_data, max_attempts: 3)
72
+ allow(@sf_update).to receive(:send_bulk_operation) { SfBulkHelperStubs.contact_update_raw_result }
73
+ end
74
+
75
+ describe 'collected result' do
76
+ it 'indicates whether each record was successful' do
77
+ expect(@sf_update.result.map { |r| r.has_key? 'success' }.uniq).to match_array([true])
78
+ end
79
+
80
+ it 'indicates whether each record was created' do
81
+ expect(@sf_update.result.map { |r| r.has_key? 'created' }.uniq).to match_array([true])
82
+ end
83
+ end
84
+
85
+ describe 'retrying failed records' do
86
+ context 'when the retry fails' do
87
+ before do
88
+ allow(@sf_update).to receive(:send_bulk_operation) { SfBulkHelperStubs.contact_update_with_fail_raw_result }
89
+ end
90
+
91
+ it 'raises an error' do
92
+ expect { @sf_update.result }.to raise_error(SfBulkHelper::MaxAttemptError)
93
+ end
94
+
95
+ it 'includes only the failed records in the retry attempt' do
96
+ @sf_update.result rescue SfBulkHelper::MaxAttemptError
97
+ retry_data = @sf_update.instance_eval('@data')
98
+ expect(retry_data.size).to eq SfBulkHelperStubs.contact_update_with_fail_raw_result['numberRecordsFailed'].first.to_i
99
+ end
100
+ end
101
+
102
+ context 'when the retry is successful' do
103
+ before do
104
+ allow(@sf_update).to receive(:send_bulk_operation).and_return(
105
+ SfBulkHelperStubs.contact_update_with_fail_raw_result,
106
+ SfBulkHelperStubs.contact_update_subsequent_success_raw_result
107
+ )
108
+ end
109
+
110
+ it 'stops retrying after success' do
111
+ @sf_update.result
112
+ expect(@sf_update.instance_eval('@attempts[:total]')).to eq 2
113
+ end
114
+ end
115
+ end
116
+ end
117
+ end
@@ -137,11 +137,13 @@ describe Testing::DataStub do
137
137
 
138
138
 
139
139
  context 'stubbed dataframe data' do
140
- let(:stub_tester) do
141
- StubTester.new(fields: {
140
+ let(:stub_tester) { StubTester.new }
141
+
142
+ before do
143
+ stub_tester.fields = {
142
144
  my_date: { type: :date, in_format: '%m/%d/%Y' },
143
145
  my_str: {}
144
- })
146
+ }
145
147
  end
146
148
 
147
149
  context '#empty_stub_df' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.42
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sterling Paramore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-08 00:00:00.000000000 Z
11
+ date: 2016-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bond
@@ -164,6 +164,48 @@ dependencies:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
166
  version: 0.2.7
167
+ - !ruby/object:Gem::Dependency
168
+ name: yard
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '0.9'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '0.9'
181
+ - !ruby/object:Gem::Dependency
182
+ name: redcarpet
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '3.3'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '3.3'
195
+ - !ruby/object:Gem::Dependency
196
+ name: github-markup
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '1.4'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '1.4'
167
209
  description: Data manipulation and ETL in Ruby
168
210
  email:
169
211
  - sterling.paramore@insidetrack.com
@@ -176,13 +218,13 @@ files:
176
218
  - ".gitignore"
177
219
  - ".rspec"
178
220
  - ".ruby-version"
221
+ - ".yardopts"
179
222
  - Gemfile
180
223
  - Gemfile.lock
181
224
  - LICENSE.txt
182
225
  - README.md
183
226
  - bin/remi
184
227
  - doc/install-rbenv-os_x.md
185
- - features/aggregate.feature
186
228
  - features/csv_file_target_job.feature
187
229
  - features/examples.feature
188
230
  - features/formulas.feature
@@ -192,6 +234,9 @@ files:
192
234
  - features/sample_job.feature
193
235
  - features/sftp_file_target_job.feature
194
236
  - features/step_definitions/remi_step.rb
237
+ - features/sub_job_example.feature
238
+ - features/sub_transform_example.feature
239
+ - features/sub_transform_many_to_many.feature
195
240
  - features/support/env.rb
196
241
  - features/support/env_app.rb
197
242
  - features/transforms/concatenate.feature
@@ -203,7 +248,6 @@ files:
203
248
  - features/transforms/prefix.feature
204
249
  - features/transforms/truncate.feature
205
250
  - features/transforms/truthy.feature
206
- - jobs/aggregate_job.rb
207
251
  - jobs/all_jobs_shared.rb
208
252
  - jobs/copy_source_job.rb
209
253
  - jobs/csv_file_target_job.rb
@@ -212,6 +256,9 @@ files:
212
256
  - jobs/parameters_job.rb
213
257
  - jobs/sample_job.rb
214
258
  - jobs/sftp_file_target_job.rb
259
+ - jobs/sub_job_example_job.rb
260
+ - jobs/sub_transform_example_job.rb
261
+ - jobs/sub_transform_many_to_many_job.rb
215
262
  - jobs/transforms/concatenate_job.rb
216
263
  - jobs/transforms/data_frame_sieve_job.rb
217
264
  - jobs/transforms/date_diff_job.rb
@@ -219,7 +266,6 @@ files:
219
266
  - jobs/transforms/parse_date_job.rb
220
267
  - jobs/transforms/partitioner_job.rb
221
268
  - jobs/transforms/prefix_job.rb
222
- - jobs/transforms/transform_jobs.rb
223
269
  - jobs/transforms/truncate_job.rb
224
270
  - jobs/transforms/truthy_job.rb
225
271
  - lib/remi.rb
@@ -228,18 +274,28 @@ files:
228
274
  - lib/remi/data_frame.rb
229
275
  - lib/remi/data_frame/daru.rb
230
276
  - lib/remi/data_subject.rb
231
- - lib/remi/data_subject/csv_file.rb
232
- - lib/remi/data_subject/data_frame.rb
233
- - lib/remi/data_subject/postgres.rb
234
- - lib/remi/data_subject/salesforce.rb
235
- - lib/remi/data_subject/sftp_file.rb
236
- - lib/remi/extractor/file_system.rb
237
- - lib/remi/extractor/local_file.rb
238
- - lib/remi/extractor/s3_file.rb
239
- - lib/remi/extractor/sftp_file.rb
277
+ - lib/remi/data_subjects/csv_file.rb
278
+ - lib/remi/data_subjects/data_frame.rb
279
+ - lib/remi/data_subjects/file_system.rb
280
+ - lib/remi/data_subjects/local_file.rb
281
+ - lib/remi/data_subjects/none.rb
282
+ - lib/remi/data_subjects/postgres.rb
283
+ - lib/remi/data_subjects/s3_file.rb
284
+ - lib/remi/data_subjects/salesforce.rb
285
+ - lib/remi/data_subjects/sftp_file.rb
286
+ - lib/remi/data_subjects/sub_job.rb
287
+ - lib/remi/dsl.rb
288
+ - lib/remi/encoder.rb
289
+ - lib/remi/extractor.rb
240
290
  - lib/remi/field_symbolizers.rb
241
291
  - lib/remi/fields.rb
242
292
  - lib/remi/job.rb
293
+ - lib/remi/job/parameters.rb
294
+ - lib/remi/job/sub_job.rb
295
+ - lib/remi/job/transform.rb
296
+ - lib/remi/loader.rb
297
+ - lib/remi/monkeys/daru.rb
298
+ - lib/remi/parser.rb
243
299
  - lib/remi/refinements/symbolizer.rb
244
300
  - lib/remi/settings.rb
245
301
  - lib/remi/sf_bulk_helper.rb
@@ -251,19 +307,31 @@ files:
251
307
  - lib/remi/transform.rb
252
308
  - lib/remi/version.rb
253
309
  - remi.gemspec
254
- - spec/data_subject/csv_file_spec.rb
255
- - spec/data_subject/data_frame.rb
256
310
  - spec/data_subject_spec.rb
257
- - spec/extractor/file_system_spec.rb
258
- - spec/extractor/local_file_spec.rb
259
- - spec/extractor/s3_file_spec.rb
260
- - spec/extractor/sftp_file_spec.rb
311
+ - spec/data_subjects/csv_file_spec.rb
312
+ - spec/data_subjects/data_frame_spec.rb
313
+ - spec/data_subjects/file_system_spec.rb
314
+ - spec/data_subjects/local_file_spec.rb
315
+ - spec/data_subjects/none_spec.rb
316
+ - spec/data_subjects/postgres_spec.rb
317
+ - spec/data_subjects/s3_file_spec.rb
318
+ - spec/data_subjects/salesforce_spec.rb
319
+ - spec/data_subjects/sftp_file_spec.rb
320
+ - spec/data_subjects/sub_job_spec.rb
321
+ - spec/encoder_spec.rb
322
+ - spec/extractor_spec.rb
261
323
  - spec/fields_spec.rb
262
324
  - spec/fixtures/basic.csv
263
325
  - spec/fixtures/basic2.csv
326
+ - spec/fixtures/sf_bulk_helper_stubs.rb
264
327
  - spec/fixtures/unsupported_escape.csv
328
+ - spec/job/transform_spec.rb
329
+ - spec/job_spec.rb
330
+ - spec/loader_spec.rb
265
331
  - spec/metadata_spec.rb
332
+ - spec/parser_spec.rb
266
333
  - spec/remi_spec.rb
334
+ - spec/sf_bulk_helper_spec.rb
267
335
  - spec/source_to_target_map_spec.rb
268
336
  - spec/testing/data_stub_spec.rb
269
337
  - spec/transform_spec.rb
@@ -294,7 +362,6 @@ signing_key:
294
362
  specification_version: 4
295
363
  summary: Remi (Ruby Extract Map Integrate)
296
364
  test_files:
297
- - features/aggregate.feature
298
365
  - features/csv_file_target_job.feature
299
366
  - features/examples.feature
300
367
  - features/formulas.feature
@@ -304,6 +371,9 @@ test_files:
304
371
  - features/sample_job.feature
305
372
  - features/sftp_file_target_job.feature
306
373
  - features/step_definitions/remi_step.rb
374
+ - features/sub_job_example.feature
375
+ - features/sub_transform_example.feature
376
+ - features/sub_transform_many_to_many.feature
307
377
  - features/support/env.rb
308
378
  - features/support/env_app.rb
309
379
  - features/transforms/concatenate.feature
@@ -315,19 +385,31 @@ test_files:
315
385
  - features/transforms/prefix.feature
316
386
  - features/transforms/truncate.feature
317
387
  - features/transforms/truthy.feature
318
- - spec/data_subject/csv_file_spec.rb
319
- - spec/data_subject/data_frame.rb
320
388
  - spec/data_subject_spec.rb
321
- - spec/extractor/file_system_spec.rb
322
- - spec/extractor/local_file_spec.rb
323
- - spec/extractor/s3_file_spec.rb
324
- - spec/extractor/sftp_file_spec.rb
389
+ - spec/data_subjects/csv_file_spec.rb
390
+ - spec/data_subjects/data_frame_spec.rb
391
+ - spec/data_subjects/file_system_spec.rb
392
+ - spec/data_subjects/local_file_spec.rb
393
+ - spec/data_subjects/none_spec.rb
394
+ - spec/data_subjects/postgres_spec.rb
395
+ - spec/data_subjects/s3_file_spec.rb
396
+ - spec/data_subjects/salesforce_spec.rb
397
+ - spec/data_subjects/sftp_file_spec.rb
398
+ - spec/data_subjects/sub_job_spec.rb
399
+ - spec/encoder_spec.rb
400
+ - spec/extractor_spec.rb
325
401
  - spec/fields_spec.rb
326
402
  - spec/fixtures/basic.csv
327
403
  - spec/fixtures/basic2.csv
404
+ - spec/fixtures/sf_bulk_helper_stubs.rb
328
405
  - spec/fixtures/unsupported_escape.csv
406
+ - spec/job/transform_spec.rb
407
+ - spec/job_spec.rb
408
+ - spec/loader_spec.rb
329
409
  - spec/metadata_spec.rb
410
+ - spec/parser_spec.rb
330
411
  - spec/remi_spec.rb
412
+ - spec/sf_bulk_helper_spec.rb
331
413
  - spec/source_to_target_map_spec.rb
332
414
  - spec/testing/data_stub_spec.rb
333
415
  - spec/transform_spec.rb
@@ -1,42 +0,0 @@
1
- Feature: Tests the aggregate refinement to the Daru library
2
-
3
- Background:
4
- Given the job is 'Aggregate'
5
- And the job source 'Source Data'
6
- And the job target 'Target Data'
7
- And the job target 'Multigroup Target Data'
8
-
9
- And the source 'Source Data'
10
-
11
-
12
- Scenario: The aggregator should find the minimum year for each 'Alpha'
13
- Given the target 'Target Data'
14
- And the following example record for 'Source Data':
15
- | Alpha | Beta | Year |
16
- | a | aa | 2016 |
17
- | a | aa | 2018 |
18
- | b | bb | 2016 |
19
- | b | bb | 2010 |
20
- | a | ab | 2017 |
21
- And the following example record called 'expected result':
22
- | Alpha | Year |
23
- | a | Group a has a minimum value of 2016 |
24
- | b | Group b has a minimum value of 2010 |
25
- Then the target should match the example 'expected result'
26
-
27
-
28
- Scenario: The aggregator should find the minimum year for each 'Alpha'
29
- Given the target 'Multigroup Target Data'
30
- And the following example record for 'Source Data':
31
- | Alpha | Beta | Year |
32
- | a | aa | 2016 |
33
- | a | aa | 2018 |
34
- | b | bb | 2016 |
35
- | b | bb | 2010 |
36
- | a | ab | 2017 |
37
- And the following example record called 'expected result':
38
- | Alpha | Beta | Year |
39
- | a | aa | Group ["a", "aa"] has a minimum value of 2016 |
40
- | a | ab | Group ["a", "ab"] has a minimum value of 2017 |
41
- | b | bb | Group ["b", "bb"] has a minimum value of 2010 |
42
- Then the target should match the example 'expected result'