rast 0.4.2.pre → 0.6.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/examples/double_example.rb +12 -0
- data/lib/rast/spec_dsl.rb +5 -10
- data/rast.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b708941b4f497bb2d44a7cecc41bc844461668c0ddf9eb60a4b144f369dd52e
|
4
|
+
data.tar.gz: 98d80de81bac24dad2758a067764dfd0ed94797bb287bd3123e73d3b1ded81f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6517e83a1f82f3882a85a8045b74e050e007bcab59d680b966c20653ab1c46b9b0b29d4279d8717ea390dc418ec0c77c010456fdd385ef5f46f1a0529773092c
|
7
|
+
data.tar.gz: c30acef08531bd2abbdcfc01fa7ba972851c3e2e805b7e2f839b356f1d58113bb672849f27c18b335d53ab8f1e4f1afea6767cf569e7705df12e30fe93b214e2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
+
- 0.6.0.pre - Reverted redesign.
|
4
|
+
- 0.5.0.pre - Redesigned to have subject as first block parameter. Everything inside
|
5
|
+
the prepare block now runs under the context of RSpec.
|
3
6
|
- 0.4.2.pre - Fix 4 tokens bug, due to mis-configured converters
|
4
7
|
- 0.4.1.pre - Fix negative? invocation.
|
5
8
|
- 0.4.0.pre - Allow yaml-less configuration.
|
data/lib/rast/spec_dsl.rb
CHANGED
@@ -127,18 +127,13 @@ def generate_rspec(scope: nil, scenario: {}, expected: '')
|
|
127
127
|
it "[#{expected}]=[#{spec_params}]" do
|
128
128
|
block_params = scenario.values
|
129
129
|
|
130
|
-
|
131
|
-
|
130
|
+
@mysubject = scope.subject
|
131
|
+
class << self
|
132
|
+
define_method(:subject) { @mysubject }
|
132
133
|
end
|
133
134
|
|
134
|
-
|
135
|
-
|
136
|
-
second_meth = scope.rspec_methods.shift
|
137
|
-
if first_meth[:name] == :allow && second_meth[:name] == :receive
|
138
|
-
allow(scope.subject)
|
139
|
-
.to receive(second_meth[:args], &second_meth[:block])
|
140
|
-
end
|
141
|
-
scope.rspec_methods.shift
|
135
|
+
if scope.rspec_methods.size > 0 || !scope.prepare_block.nil?
|
136
|
+
instance_exec(*block_params, &scope.prepare_block)
|
142
137
|
end
|
143
138
|
|
144
139
|
actual = scope.execute_block.call(*block_params).to_s
|
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.
|
4
|
+
version: 0.6.0.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-28 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.
|
@@ -26,6 +26,7 @@ files:
|
|
26
26
|
- Gemfile.lock
|
27
27
|
- README.md
|
28
28
|
- examples/arithmetic_module.rb
|
29
|
+
- examples/double_example.rb
|
29
30
|
- examples/factory_example.rb
|
30
31
|
- examples/logic_checker.rb
|
31
32
|
- examples/logic_four.rb
|