teuton 2.3.7 → 2.3.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec3ce7a6b9c34c5ee3aba1203009dbe2a9c334e413ad695795f73e351fd466f0
4
- data.tar.gz: 99d57501268057252084f3175a3f728e855200fc0319714229fb2f820e1ffef3
3
+ metadata.gz: '0873f32e05d17fdf4c3903594c5e7fa63746afe919b186900ca5e123358ebb08'
4
+ data.tar.gz: fba17dd71e723d555eeca03a671cb2b171a00b4c874d763325e0dd5921162da4
5
5
  SHA512:
6
- metadata.gz: a476ced60b6439210596dcf224d3dcac7f27edf63b6683f3dd32458f173afd27e33d434f1611ff8572659440f96a96ad0078ff549ce3f3b2e113bf0c0e77cb82
7
- data.tar.gz: 3c4d5866483aa04ec9559992c4cf5512a095c91b61a7058f454f511865c82d7d14e8986be87d2bb3f9a06d9828079066144be373b8307caca719443eafe179d5
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.6)
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?("_") && a.end_with?("_")
36
- return instance_eval("get(:#{a[1, a.size - 2]})", __FILE__, __LINE__)
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
@@ -1,5 +1,5 @@
1
1
  module Teuton
2
- VERSION = "2.3.7"
2
+ VERSION = "2.3.8"
3
3
  APPNAME = "teuton"
4
4
  GEMNAME = "teuton"
5
5
  DOCKERNAME = "dvarrui/#{GEMNAME}"
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.7
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