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 +5 -2
- data/CHANGELOG.md +1 -0
- data/lib/rast/parameter_generator.rb +2 -12
- data/lib/rast/rast_spec.rb +6 -1
- data/lib/rast/rules/rule_evaluator.rb +2 -2
- data/lib/rast/rules/rule_processor.rb +1 -1
- data/rast.gemspec +1 -1
- metadata +2 -2
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:
|
4
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b2b1229f6c792830818032f0bf4033ddee513618f19f02c29160222f831bbf9b3751d2d3bca49115b2b633eba6ea86afa1da20ed7507cb6a5bd2bce2513f1ba
|
7
|
+
data.tar.gz: c13bcce9b0590bdd9cb53f9d44d76b5cf405c2eb3d542836dbf3c9fd96c639a58b2f80a7f5071ea7ea8fcdd064493cf953530bde1cd43aecbe15c1c1e52cafdf
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/lib/rast/rast_spec.rb
CHANGED
@@ -25,7 +25,12 @@ class RastSpec
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def init_converters(converters: [])
|
28
|
-
@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 = []
|
data/rast.gemspec
CHANGED
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.
|
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-
|
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.
|