rast 0.4.1.pre → 0.4.2.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/README.md +11 -6
- data/examples/logic_four.rb +15 -0
- data/lib/rast/rast_spec.rb +6 -3
- data/lib/rast/rules/rule_evaluator.rb +2 -2
- data/lib/rast/rules/rule_processor.rb +1 -1
- data/rast.gemspec +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4c0904a8baf8935d4b5406684e613f7626c7ca9fdbe4cc17e99a2ae09ecdd53
|
4
|
+
data.tar.gz: 239da4c4e5e41afb4429a2051dc2d0b2ed32e85f02ae32e646e194ff6ebc1a62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b4f4c9257e3db7fcb50e89053a66ca25a17feda4cb815fe35dec89e00001f38e19e3b35854b1c8ecd1c07079922efc2947dd57a10ee0b9ba930cb1db7b8de17
|
7
|
+
data.tar.gz: e2c3c03e3fffb117112f25c5307e4928bd059109f1e54c9fd5077ebf0bb9be6fdba6c38fe4d98adb02694e888b093346fc3062c0913239445dbde6f91beda541
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,13 +3,13 @@ RSpec All Scenario Testing
|
|
3
3
|
|
4
4
|
## Definition of terms
|
5
5
|
|
6
|
-
`spec` - as defined in the yaml file, the individual elements under `specs`
|
7
|
-
`scenario` - a specific combination of tokens from vars, it can uniquely identify a fixture.
|
8
|
-
`fixture` - instance of a spec, containing a scenario, reference back to the spec, and the expected result for the given scenario.
|
9
|
-
`variables` - raw list of variables to be combined into multiple fixtures.
|
6
|
+
`spec` - as defined in the yaml file, the individual elements under `specs`
|
7
|
+
`scenario` - a specific combination of tokens from vars, it can uniquely identify a fixture.
|
8
|
+
`fixture` - instance of a spec, containing a scenario, reference back to the spec, and the expected result for the given scenario.
|
9
|
+
`variables` - raw list of variables to be combined into multiple fixtures.
|
10
10
|
`rule` - set of outcome paired with rule clause.
|
11
|
-
`exemption/exclusions` - rule defining variable combinations to be excluded from the test.
|
12
|
-
`outcome` - the left portion of a rule e.g. `true: true&true`
|
11
|
+
`exemption/exclusions` - rule defining variable combinations to be excluded from the test.
|
12
|
+
`outcome` - the left portion of a rule e.g. `true: true&true`
|
13
13
|
`clause` - the right portion of a rule
|
14
14
|
|
15
15
|
|
@@ -22,3 +22,8 @@ DSL. The DSL will then invoke the parameter generator to generate the scenarios.
|
|
22
22
|
|
23
23
|
- Increment the .gemspec
|
24
24
|
- Modify the CHANGELOG.md
|
25
|
+
|
26
|
+
## Releasing GEM
|
27
|
+
|
28
|
+
Build gem with `gem build rast.gemspec`
|
29
|
+
Publish with `gem push <gem-filename>`
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Checks bug introduced when converters was combined with token converter.
|
4
|
+
#
|
5
|
+
# @author Royce Remulla
|
6
|
+
#
|
7
|
+
class LogicFour
|
8
|
+
# Perform logical AND operation on two arguments.
|
9
|
+
#
|
10
|
+
# @param argument1 first argument of Boolean type.
|
11
|
+
# @param argument2 second argument of Boolean type.
|
12
|
+
def process(argument1, argument2, argument3, argument4)
|
13
|
+
!argument1 && !argument2 && !argument3 && argument4 == 'a'
|
14
|
+
end
|
15
|
+
end
|
data/lib/rast/rast_spec.rb
CHANGED
@@ -2,8 +2,10 @@
|
|
2
2
|
|
3
3
|
# CaseFixture.java, containing an actual and specific combination of variables.
|
4
4
|
class RastSpec
|
5
|
+
# token_converter is the mapping of a variable token to a converter
|
6
|
+
# converters is a list of converters used via positional tokens.
|
5
7
|
attr_reader :variables, :pair, :pair_reversed, :rule, :description,
|
6
|
-
:exclude_clause, :converters
|
8
|
+
:exclude_clause, :token_converter, :converters
|
7
9
|
|
8
10
|
attr_accessor :exclude
|
9
11
|
|
@@ -25,11 +27,12 @@ class RastSpec
|
|
25
27
|
end
|
26
28
|
|
27
29
|
def init_converters(converters: [])
|
28
|
-
@converters =
|
30
|
+
@converters = converters
|
31
|
+
@token_converter = {}
|
29
32
|
|
30
33
|
@variables.keys.each_with_index do |key, index|
|
31
34
|
@variables[key].each do |element|
|
32
|
-
@
|
35
|
+
@token_converter[element.to_s] = converters[index]
|
33
36
|
end
|
34
37
|
end
|
35
38
|
|
@@ -35,8 +35,8 @@ class RuleEvaluator
|
|
35
35
|
}.freeze
|
36
36
|
|
37
37
|
# /** @param pConverterList list of rule token converters. */
|
38
|
-
def initialize(converters:
|
39
|
-
@converters = converters
|
38
|
+
def initialize(converters: [])
|
39
|
+
@converters = converters
|
40
40
|
|
41
41
|
@stack_operations = []
|
42
42
|
@stack_rpn = []
|
data/rast.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Royce Remulla
|
@@ -18,9 +18,9 @@ executables: []
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
-
-
|
22
|
-
-
|
23
|
-
-
|
21
|
+
- .gitignore
|
22
|
+
- .rspec
|
23
|
+
- .rubocop.yml
|
24
24
|
- CHANGELOG.md
|
25
25
|
- Gemfile
|
26
26
|
- Gemfile.lock
|
@@ -28,6 +28,7 @@ files:
|
|
28
28
|
- examples/arithmetic_module.rb
|
29
29
|
- examples/factory_example.rb
|
30
30
|
- examples/logic_checker.rb
|
31
|
+
- examples/logic_four.rb
|
31
32
|
- examples/phone.rb
|
32
33
|
- examples/prime_number.rb
|
33
34
|
- examples/recruiter.rb
|
@@ -62,16 +63,16 @@ require_paths:
|
|
62
63
|
- lib
|
63
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
64
65
|
requirements:
|
65
|
-
- -
|
66
|
+
- - ~>
|
66
67
|
- !ruby/object:Gem::Version
|
67
68
|
version: '2.0'
|
68
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
70
|
requirements:
|
70
|
-
- -
|
71
|
+
- - '>'
|
71
72
|
- !ruby/object:Gem::Version
|
72
73
|
version: 1.3.1
|
73
74
|
requirements: []
|
74
|
-
rubygems_version: 3.
|
75
|
+
rubygems_version: 3.0.8
|
75
76
|
signing_key:
|
76
77
|
specification_version: 4
|
77
78
|
summary: RSpec AST - All Scenario Testing
|