rast 0.14.0 → 0.15.1

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: 810c0efa487bd01ba81b1d2cf93a99bf46ef46c7cf614ba89d0e738f11d69269
4
- data.tar.gz: 3ab5f8339648ef7740671bdd158357daab93cd887edadd506938072d4232b4de
3
+ metadata.gz: c182ee63c3f1cb18ff294cd27be2dca33553cc9f15295ee50848274fdf0a6b90
4
+ data.tar.gz: 69de9f82cbc4dd45c5c8ac8a275a2eb586fe5cd531ec3ef52638b70c035e7ebd
5
5
  SHA512:
6
- metadata.gz: 7232e32ecc826d7224e79a0e6d551b4d00bf7973b29c34ec9bc970f17ff58ec787a480b347fb612155b2a650fffd908ec8f1b388c8148dc16584b51ae9e5cd0c
7
- data.tar.gz: 40e29551bba818a212168dc2a39112e28f35168b6a9164d4cdbcd4daf4f89215b3e8f0aec0a49cdc81e3ea4f0bf7d0152e1a28d64e12a1c47663887cd90b48aa
6
+ metadata.gz: ee7e4c7fd412ef942a78be18fddaac3b58718724f2ad89f83f728781a347913202d80abe81c99d1b43bbe06030d7de8cfbd735a3a87f9f3ebe0b39b19bd5bf1b
7
+ data.tar.gz: 4cd8885dab731bf4a4c3bed1d2402099545a0bc53b97a26207f99e4190f8508bdc1c2ae2b687bd51f441d29438d313335aa384e470aee298a4a433b411bfa7d3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Change log
2
2
 
3
+ - 0.15.1 - Fix converters when variable is multi typed.
3
4
  - 0.14.0 - Introduced an else config as substitute for pair.
4
5
  - 0.13.0 - Make pair in config optional for boolean result.
5
6
  - 0.12.0 - Allow non-string tokens in the rules.
data/README.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Overview
2
+
2
3
  RSpec All Scenario Testing
3
4
 
5
+ This library runs on top of RSpec to provide basically a parameterized unit testing pattern. It follows a specific pattern of writing unit tests, enabling a predictable, complete and easy to analyze report result.
6
+
7
+
4
8
  ## Definition of terms
5
9
 
6
10
  `spec` - as defined in the yaml file, the individual elements under `specs`
data/examples/positive.rb CHANGED
@@ -3,6 +3,8 @@
3
3
  # Example single number answer
4
4
  class Positive
5
5
  def positive?(number)
6
+ raise "Invalid parameter: #{number}" unless number.is_a?(Integer) || number.is_a?(Float)
7
+
6
8
  number > 0
7
9
  end
8
10
  end
@@ -24,6 +24,7 @@ class ParameterGenerator
24
24
  spec_config = @specs_config[spec_id]
25
25
 
26
26
  spec_config[:description] = spec_id
27
+ spec_config['rules'] ||= spec_config['outcomes']
27
28
  spec = instantiate_spec(spec_config)
28
29
 
29
30
  list = []
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'rast/rules/rule_evaluator'
4
+
3
5
  # CaseFixture.java, containing an actual and specific combination of variables.
4
6
  class RastSpec
5
7
  # token_converter is the mapping of a variable token to a converter
@@ -32,7 +34,8 @@ class RastSpec
32
34
 
33
35
  @variables.keys.each_with_index do |key, index|
34
36
  @variables[key].each do |element|
35
- @token_converter[element.to_s] = converters[index]
37
+ converter = RuleEvaluator::DEFAULT_CONVERT_HASH[element.class] || converters[index]
38
+ @token_converter[element.to_s] = converter
36
39
  end
37
40
  end
38
41
 
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.14.0'
5
+ spec.version = '0.15.1'
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.14.0
4
+ version: 0.15.1
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-05-03 00:00:00.000000000 Z
11
+ date: 2020-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: factory_girl