rast 0.1.1.pre → 0.1.2.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,4 +1,7 @@
1
1
  ---
2
+ SHA256:
3
+ metadata.gz: 61e7fa17b5ace2ff106da6596ebd01b2c2eb86108164e7218724bf8d694cb649
4
+ data.tar.gz: df4432d78b4d353c7977969d96cfab2f7809db2c6e70b31c6b82ad95fc80298f
2
5
  SHA512:
3
- metadata.gz: 27a95910bf913315b1188d751aaabefe976ebcc78ae8f827fdc71d5ca8d0ff162e3a0fa2af20abdccaf1ba8d5ba62d6cc2f9b470c3b38c05198c6e8a0109b6f4
4
- data.tar.gz: 9704f5073764d040472332937b435d5156b6457309d5ab08cbe0b6eb1c2d79f2b523fd00e391fc5eec7ae95ce0a4428b1f1805b4ed43a1e9ee8275d732eb9627
6
+ metadata.gz: 4b2b1229f6c792830818032f0bf4033ddee513618f19f02c29160222f831bbf9b3751d2d3bca49115b2b633eba6ea86afa1da20ed7507cb6a5bd2bce2513f1ba
7
+ data.tar.gz: c13bcce9b0590bdd9cb53f9d44d76b5cf405c2eb3d542836dbf3c9fd96c639a58b2f80a7f5071ea7ea8fcdd064493cf953530bde1cd43aecbe15c1c1e52cafdf
data/CHANGELOG.md CHANGED
@@ -1,3 +1,4 @@
1
1
  # Change log
2
2
 
3
+ 0.1.2.pre - Fixed exclusions
3
4
  0.1.1.pre - Pre release version compatible with Ruby 2.0.0-p247
@@ -13,8 +13,6 @@ require 'rast/converters/float_converter'
13
13
  class ParameterGenerator
14
14
  def initialize(yaml_path: '')
15
15
  @specs_config = YAML.load_file(yaml_path)['specs']
16
-
17
- # p @specs_config
18
16
  end
19
17
 
20
18
  # addCase. Generate the combinations, then add the fixture to the final list
@@ -32,6 +30,7 @@ class ParameterGenerator
32
30
 
33
31
  (1...variables.size).each { |i| multipliers << variables.values[i].dup }
34
32
  scenarios = var_first.last.product(*multipliers)
33
+
35
34
  add_fixtures(scenarios: scenarios, spec: spec, list: list)
36
35
  list
37
36
  end
@@ -44,6 +43,7 @@ class ParameterGenerator
44
43
  exclude_clause = spec.exclude_clause
45
44
  rule_evaluator = RuleEvaluator.new(converters: spec.converters)
46
45
  rule_evaluator.parse(expression: exclude_clause)
46
+
47
47
  rule_evaluator.evaluate(scenario: scenario, rule_token_convert: spec.converters) == "false"
48
48
  end
49
49
 
@@ -60,15 +60,6 @@ class ParameterGenerator
60
60
 
61
61
  def build_param(validator, scenario, spec)
62
62
  param = { spec: spec, scenario: {} }
63
- token_converter = {}
64
-
65
- spec.variables.keys.each_with_index do |key, index|
66
- spec.variables[key].each do |element|
67
- unless spec.converters.nil?
68
- token_converter[element.to_s] = spec.converters[index]
69
- end
70
- end
71
- end
72
63
 
73
64
  spec.variables.keys.zip(scenario) do |array|
74
65
  var_name = array.first.to_sym
@@ -76,7 +67,6 @@ class ParameterGenerator
76
67
  param[:scenario][var_name] = var_value
77
68
  end
78
69
 
79
- param[:converter_hash] = token_converter
80
70
  param[:expected_outcome] = validator.validate(
81
71
  scenario: scenario,
82
72
  fixture: param
@@ -25,7 +25,12 @@ class RastSpec
25
25
  end
26
26
 
27
27
  def init_converters(converters: [])
28
- @converters = converters
28
+ @converters = {}
29
+
30
+ @variables.keys.each_with_index do |key, index|
31
+ @variables[key].each { |element| @converters[element.to_s] = converters[index] }
32
+ end
33
+
29
34
  self
30
35
  end
31
36
 
@@ -33,8 +33,8 @@ class RuleEvaluator
33
33
  }.freeze
34
34
 
35
35
  # /** @param pConverterList list of rule token converters. */
36
- def initialize(converters: [])
37
- @converters = converters
36
+ def initialize(converters: {})
37
+ @converters = converters.values
38
38
 
39
39
  @stack_operations = []
40
40
  @stack_rpn = []
@@ -35,7 +35,7 @@ class RuleProcessor
35
35
 
36
36
  list << rule_evaluator.evaluate(
37
37
  scenario: scenario,
38
- rule_token_convert: fixture[:converter_hash]
38
+ rule_token_convert: spec.converters
39
39
  )
40
40
  end
41
41
  end
data/rast.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'rast'
5
- spec.version = '0.1.1.pre'
5
+ spec.version = '0.1.2.pre'
6
6
  spec.authors = ['Royce Remulla']
7
7
  spec.email = ['royce.com@gmail.com']
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.pre
4
+ version: 0.1.2.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Royce Remulla
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-20 00:00:00.000000000 Z
11
+ date: 2020-04-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Extends RSpec functionality by using the catch-all-scenario testing (CAST)
14
14
  principle.