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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcc1b1f4b05d1b189a6388fd758e9d190c41002fb6da523628555dc40594a898
4
- data.tar.gz: 8c205ea8d6592a4d9aa48209232b6315731fee44889121f9d07286ec63158d8b
3
+ metadata.gz: c4c0904a8baf8935d4b5406684e613f7626c7ca9fdbe4cc17e99a2ae09ecdd53
4
+ data.tar.gz: 239da4c4e5e41afb4429a2051dc2d0b2ed32e85f02ae32e646e194ff6ebc1a62
5
5
  SHA512:
6
- metadata.gz: a1760d86959eded6536a2bc7a63a994d45da84517be6a1b6c49c66b9c5159daeb49f8cbd961ca06655464173db2e8f58782c20ef3dcf68d8074d8d7b4ead3ded
7
- data.tar.gz: 1901665a418b15ba6fc54175ed753788d1297991a935f69aad18a71ba69c957b4aea24ccce12e76bda7c564c68e6dbb7571bd4c3a4b4d026c4e12463323961d2
6
+ metadata.gz: 9b4f4c9257e3db7fcb50e89053a66ca25a17feda4cb815fe35dec89e00001f38e19e3b35854b1c8ecd1c07079922efc2947dd57a10ee0b9ba930cb1db7b8de17
7
+ data.tar.gz: e2c3c03e3fffb117112f25c5307e4928bd059109f1e54c9fd5077ebf0bb9be6fdba6c38fe4d98adb02694e888b093346fc3062c0913239445dbde6f91beda541
data/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Change log
2
2
 
3
+ - 0.4.2.pre - Fix 4 tokens bug, due to mis-configured converters
3
4
  - 0.4.1.pre - Fix negative? invocation.
4
5
  - 0.4.0.pre - Allow yaml-less configuration.
5
6
  - 0.3.1.pre - Fixed spec naming for modules.
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
@@ -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
- @converters[element.to_s] = converters[index]
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.values
38
+ def initialize(converters: [])
39
+ @converters = converters
40
40
 
41
41
  @stack_operations = []
42
42
  @stack_rpn = []
@@ -35,7 +35,7 @@ class RuleProcessor
35
35
 
36
36
  list << rule_evaluator.evaluate(
37
37
  scenario: scenario,
38
- rule_token_convert: spec.converters
38
+ rule_token_convert: spec.token_converter
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.4.1.pre'
5
+ spec.version = '0.4.2.pre'
6
6
  spec.authors = ['Royce Remulla']
7
7
  spec.email = ['royce.com@gmail.com']
8
8
 
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.1.pre
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
- - ".gitignore"
22
- - ".rspec"
23
- - ".rubocop.yml"
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.1.2
75
+ rubygems_version: 3.0.8
75
76
  signing_key:
76
77
  specification_version: 4
77
78
  summary: RSpec AST - All Scenario Testing