remi 0.2.23 → 0.2.24

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2a0f05a4c89db273e240cd2bfea455bfe757608
4
- data.tar.gz: 4d25d0f4cea2a394342814c0a4de401fea42e797
3
+ metadata.gz: ceb5656a8d423c9977d429c8860675634306e7f3
4
+ data.tar.gz: 8cee6d8de9480b1bb87fa51fd3599f98ceaae81d
5
5
  SHA512:
6
- metadata.gz: 875477752da888b12159e436e0f17b19df54722db4e1550712a6a8e01007a907bbb1c0096f9d8e490bde9378d9b5fa67d1c17607e622481e1e3b64dc50357a74
7
- data.tar.gz: 414093bef26b68d45a9e3614d4014fe9ca2412b9e785dd9bc799ccf19f271e6a8abe71c6a55f488df17b8fcb93dbdc93f1ec3baac8d3c06058992e44ea054b9d
6
+ metadata.gz: 4a2f58abebea15a06579dfec3dd5ca17d2edb4aa150082096b0d8d62b3399a3c6c01abdac0734280643a80d97ca8ccd6feea652970c402e5da5222f03298b796
7
+ data.tar.gz: fa61072a96440a8798ff7b58203d35ff26d4a3de87690b059838b81f724c5b4c7324de43d89fae266d5a48c284ad8aad1bca7185051da68b071ec664061deb45
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- remi (0.2.23)
4
+ remi (0.2.24)
5
5
  activesupport (~> 4.2)
6
6
  bond (~> 0.5)
7
7
  cucumber (~> 2.1)
@@ -284,22 +284,35 @@ Then /^the target field '(.+)' is the date (.+)$/ do |target_field, date_referen
284
284
  step "the target field '#{target_field}' is set to the value \"*#{date_reference}*\""
285
285
  end
286
286
 
287
- Then /^the target '(.+)' should match the example '([[:alnum:]\s]+)'$/ do |target_name, example_name|
287
+ Then /^the target '(.+)' should match the example '([[:alnum:]\-\s]+)'$/ do |target_name, example_name|
288
288
  @brt.run_transforms
289
289
 
290
290
  target_hash = @brt.targets[target_name].column_hash
291
291
  example_hash = @brt.examples[example_name].column_hash
292
292
  common_keys = target_hash.keys & example_hash.keys
293
293
 
294
- expect(target_hash.select { |k,v| common_keys.include? k })
295
- .to eq example_hash.select { |k,v| common_keys.include? k }
294
+ target_to_compare = target_hash.select { |k,v| common_keys.include? k }
295
+ target_to_compare.each do |k, v|
296
+ target_to_compare[k] = v.map { |e| e.to_s }
297
+ end
298
+
299
+ example_to_compare = example_hash.select { |k,v| common_keys.include? k }
300
+
301
+ expect(target_to_compare).to eq example_to_compare
296
302
  end
297
303
 
298
- Then /^the target should match the example '([[:alnum:]\s]+)'$/ do |example_name|
304
+ Then /^the target should match the example '([[:alnum:]\-\s]+)'$/ do |example_name|
299
305
  target_name = @brt.targets.keys.first
300
306
  step "the target '#{target_name}' should match the example '#{example_name}'"
301
307
  end
302
308
 
309
+ Then /^the target should match the example:/ do |example_table|
310
+ example_name = SecureRandom.uuid
311
+ @brt.add_example example_name, example_table
312
+ step "the target should match the example '#{example_name}'"
313
+ end
314
+
315
+
303
316
  Then /^the target field '(.+)' is populated from the source field '(.+)' after translating it according to:$/ do |target_field, source_field, translation_table|
304
317
  step "the target field '#{target_field}'"
305
318
 
@@ -391,12 +404,43 @@ Then /^the target field is a concatenation of '(.+)' and "([^"]*)", delimited by
391
404
  end
392
405
  end
393
406
 
394
- Then /^the source field is prefixed with "([^"]*)" and loaded into the target field$/ do |prefix|
395
- prefixed_source = "#{prefix}#{@brt.source.field.value}"
407
+ Then /^the source field '([^']+)' is prefixed with "([^"]*)" and loaded into the target field '([^']+)'$/ do |source_field, prefix, target_field|
408
+ step "the target field '#{target_field}'"
409
+ step "the source field '#{source_field}'"
410
+
411
+ source_name, source_field_name = @brt.sources.parse_full_field(source_field)
412
+ target_names, target_field_name = @brt.targets.parse_full_field(target_field, multi: true)
413
+
414
+ prefixed_source = "#{prefix}#{@brt.sources[source_name].fields[source_field_name].value}"
415
+
396
416
  @brt.run_transforms
397
- expect(@brt.target.field.value).to eq prefixed_source
417
+ Array(target_names).each do |target_name|
418
+ expect(@brt.targets[target_name].fields[target_field_name].value).to eq prefixed_source
419
+ end
420
+
398
421
  end
399
422
 
423
+ Then /^the source field is prefixed with "([^"]*)" and loaded into the target field '([^']+)'$/ do |prefix, target_field|
424
+ @brt.sources.fields.each do |source_field|
425
+ step "the source field '#{source_field.full_name}' is prefixed with \"#{prefix}\" and loaded into the target field '#{target_field}'"
426
+ end
427
+ end
428
+
429
+ Then /^the source field '([^']+)' is prefixed with "([^"]*)" and loaded into the target field$/ do |source_field, prefix|
430
+ @brt.targets.fields.each do |target_field|
431
+ step "the source field '#{source_field}' is prefixed with \"#{prefix}\" and loaded into the target field '#{target_field.full_name}'"
432
+ end
433
+ end
434
+
435
+ Then /^the source field is prefixed with "([^"]*)" and loaded into the target field$/ do |prefix|
436
+ @brt.sources.fields.each do |source_field|
437
+ @brt.targets.fields.each do |target_field|
438
+ step "the source field '#{source_field.full_name}' is prefixed with \"#{prefix}\" and loaded into the target field '#{target_field.full_name}'"
439
+ end
440
+ end
441
+ end
442
+
443
+
400
444
  Then /^the target field '([^']+)' is populated from the source field '([^']+)' using the format "([^"]*)"$/ do |target_field, source_field, target_format|
401
445
  step "the source field '#{source_field}'"
402
446
  step "the target field '#{target_field}'"
@@ -145,7 +145,7 @@ module Remi
145
145
 
146
146
  def validate_email(substitute='')
147
147
  memoize_as_lambda(__method__, substitute) do |(msubstitute), larg|
148
- larg.match(/^.+@[a-z0-9\-\.]+$/i) ? larg : msubstitute
148
+ larg.match(/^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,}$/i) ? larg : msubstitute
149
149
  end
150
150
  end
151
151
 
data/lib/remi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Remi
2
- VERSION = '0.2.23'
2
+ VERSION = '0.2.24'
3
3
  end
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.23
4
+ version: 0.2.24
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-03-30 00:00:00.000000000 Z
11
+ date: 2016-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daru