teuton 2.3.7 → 2.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/docs/learn/14-alias.md +47 -0
- data/lib/teuton/case_manager/case/dsl/macro.rb +2 -2
- data/lib/teuton/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0873f32e05d17fdf4c3903594c5e7fa63746afe919b186900ca5e123358ebb08'
|
4
|
+
data.tar.gz: fba17dd71e723d555eeca03a671cb2b171a00b4c874d763325e0dd5921162da4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e05506134ae1dc7a4a64b0c519221a466c35ac50b15770bde019cae780f940d244ba522f5a8932791c415ab37e0530741c5f9f894320b148be417a62d2a8dced
|
7
|
+
data.tar.gz: 40b76d2fb4de366748e261eb5d8350038ed3bdc7d5d2c2d63c2ce3f81b86886dcd39686c911e75c331c090ddeaadf383136509ed8e3e73b9ff9513265ca0d5f4
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/teuton.svg)](https://badge.fury.io/rb/teuton)
|
3
3
|
![GitHub](https://img.shields.io/github/license/dvarrui/teuton)
|
4
|
-
![Gem](https://img.shields.io/gem/dv/teuton/2.3.
|
4
|
+
![Gem](https://img.shields.io/gem/dv/teuton/2.3.7)
|
5
5
|
|
6
6
|
# TEUTON
|
7
7
|
|
@@ -0,0 +1,47 @@
|
|
1
|
+
[<< back](README.md)
|
2
|
+
|
3
|
+
# Example: 14-alias
|
4
|
+
|
5
|
+
Supongamos que tenemos un test como el siguiente:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
group "Using alias" do
|
9
|
+
target "Verify user #{get(:super)} with key alias."
|
10
|
+
run "id #{get(:super)}"
|
11
|
+
expect get(:super)
|
12
|
+
|
13
|
+
target "Verify user #{_username} with method alias."
|
14
|
+
run "id #{_username}"
|
15
|
+
expect _username
|
16
|
+
end
|
17
|
+
```
|
18
|
+
|
19
|
+
Tenemos sólo 2 targets pero podríamos tener muchos más.
|
20
|
+
|
21
|
+
> Recordemos que `_username` es equivalente a `get(:username)`
|
22
|
+
|
23
|
+
Sabemos que el fichero de configuración debe definir los valores para los parámetros `super` y `username`. Queremos aprovechar un fichero de configuración que ya teníamos de otro test, pero tiene el siguiente contenido:
|
24
|
+
|
25
|
+
```yaml
|
26
|
+
# Version 1
|
27
|
+
# File: config.yaml
|
28
|
+
global:
|
29
|
+
cases:
|
30
|
+
- tt_members: Anonymous
|
31
|
+
superuser: root
|
32
|
+
username: obiwan
|
33
|
+
```
|
34
|
+
|
35
|
+
Podemos comprobar que nuestro test require el parámetro `super` pero el fichero de configuración lo ha nombrado como `superuser`.
|
36
|
+
|
37
|
+
```yaml
|
38
|
+
# Version 2
|
39
|
+
# File: config.yaml
|
40
|
+
alias:
|
41
|
+
super: :superuser
|
42
|
+
global:
|
43
|
+
cases:
|
44
|
+
- tt_members: Anonymous
|
45
|
+
superuser: root
|
46
|
+
username: obiwan
|
47
|
+
```
|
@@ -32,8 +32,8 @@ module DSL
|
|
32
32
|
# * Invoke macro (assert)
|
33
33
|
def method_missing(method, args = {})
|
34
34
|
a = method.to_s
|
35
|
-
if a.start_with?("_")
|
36
|
-
return instance_eval("get(:#{a[1, a.size -
|
35
|
+
if a.start_with?("_")
|
36
|
+
return instance_eval("get(:#{a[1, a.size - 1]})", __FILE__, __LINE__)
|
37
37
|
end
|
38
38
|
return macro a[6, a.size], args if a[0, 6] == "macro_"
|
39
39
|
macro a, args
|
data/lib/teuton/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teuton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Vargas Ruiz
|
@@ -198,6 +198,7 @@ extra_rdoc_files:
|
|
198
198
|
- docs/learn/11-moodle_id.md
|
199
199
|
- docs/learn/12-get_vars.md
|
200
200
|
- docs/learn/13-include.md
|
201
|
+
- docs/learn/14-alias.md
|
201
202
|
- docs/learn/16-exit_codes.md
|
202
203
|
- docs/learn/README.md
|
203
204
|
- docs/learn/videos.md
|
@@ -252,6 +253,7 @@ files:
|
|
252
253
|
- docs/learn/11-moodle_id.md
|
253
254
|
- docs/learn/12-get_vars.md
|
254
255
|
- docs/learn/13-include.md
|
256
|
+
- docs/learn/14-alias.md
|
255
257
|
- docs/learn/16-exit_codes.md
|
256
258
|
- docs/learn/README.md
|
257
259
|
- docs/learn/videos.md
|