hiptest-publisher 0.15.9 → 0.15.10

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
  SHA1:
3
- metadata.gz: 022ac15f7f0c91507fa65a5643de30fead66738d
4
- data.tar.gz: 7355b77f8e1e5a6767a276b94d27b75c305a8c27
3
+ metadata.gz: 67f9fb69134dd2a3e084acd9ac614198a9c27a0b
4
+ data.tar.gz: 18fb9ed4914a371f3f8ca61b15f60f5db51c983e
5
5
  SHA512:
6
- metadata.gz: 52e690c26642740d83744044ea6fd2f599cb8469556668956f06b3a249853552ebb6d51bc63fec085b371389f04c825822e379e652ac52ba654a105647c9ed08
7
- data.tar.gz: 2367aee3013df421e9a2203773f49f81dc73b2d3caecd16c94ee0c537de2583a1415d27cedbdb618d2fc79efada70b24dd1303e669adac742d8ea11b42448987
6
+ metadata.gz: 268cc8c1076a9cc53158b0c31e461ca6e032874e32260af9735e92a02632494a96922596e3f7f5b46800e98e6b406f19240cfb5a9cf08801219e9bbce855ff3a
7
+ data.tar.gz: 317d4198410c9d6f1c3d9b950fe3a430c0e67c3bee374b9b261a185f3583fabbf3377fe78020e6a51e579bd91b4828e9c8fb358727ed1f764e77f9e4d511784e
@@ -87,7 +87,7 @@ module Hiptest
87
87
  result << inline_parameter_name if inline_parameter_name
88
88
  end
89
89
  end
90
- missing_parameter_names = actionword_parameters.keys - inline_parameter_names
90
+ missing_parameter_names = actionword_parameters.keys - inline_parameter_names - ['__free_text']
91
91
 
92
92
  patterned = result.join("\"")
93
93
  missing_parameter_names.each do |missing_parameter_name|
@@ -203,6 +203,10 @@ module Hiptest
203
203
  super()
204
204
  @children = {:name => name, :value => value}
205
205
  end
206
+
207
+ def free_text?
208
+ @children[:name] == "__free_text"
209
+ end
206
210
  end
207
211
 
208
212
  class Call < Node
@@ -211,6 +215,10 @@ module Hiptest
211
215
  annotation = nil if annotation == ""
212
216
  @children = {:actionword => actionword, :arguments => arguments, :all_arguments => arguments, :annotation => annotation}
213
217
  end
218
+
219
+ def free_text_arg
220
+ children[:arguments].find(&:free_text?)
221
+ end
214
222
  end
215
223
 
216
224
  class IfThen < Node
@@ -254,6 +262,10 @@ module Hiptest
254
262
  @children[:type].to_s
255
263
  end
256
264
  end
265
+
266
+ def free_text?
267
+ @children[:name] == "__free_text"
268
+ end
257
269
  end
258
270
 
259
271
  class Item < Node
@@ -93,6 +93,7 @@ module Hiptest
93
93
 
94
94
  def walk_parameter(p)
95
95
  {
96
+ :is_free_text? => p.free_text?,
96
97
  :has_default_value? => !p.children[:default].nil?
97
98
  }
98
99
  end
@@ -24,12 +24,8 @@ module Hiptest
24
24
 
25
25
  def walk_call(call)
26
26
  # For Gherkin, we need the __free_text argument rendered.
27
- free_text_arg = call.children[:arguments].select do |arg|
28
- arg.children[:name] == '__free_text'
29
- end.first
30
-
31
- unless free_text_arg.nil?
32
- @rendered_children[:free_text_arg] = @rendered[free_text_arg.children[:value]]
27
+ if call.free_text_arg
28
+ @rendered_children[:free_text_arg] = @rendered[call.free_text_arg.children[:value]]
33
29
  end
34
30
 
35
31
  super(call)
@@ -0,0 +1,4 @@
1
+ this.After(function (scenario) {{#curly}}{{#indent}}
2
+ this.actionwords = null;
3
+ {{/indent}}
4
+ {{/curly}});
@@ -0,0 +1,4 @@
1
+ this.Before(function (scenario) {{#curly}}{{#indent}}
2
+ this.actionwords = Object.create(require('{{{ relative_path './actionwords.js' }}}').Actionwords);
3
+ {{/indent}}
4
+ {{/curly}});
@@ -1,5 +1,7 @@
1
1
  module.exports = function () {{#curly}}{{#indent}}
2
- {{> around_hook}}
2
+ {{> before_hook}}
3
+
4
+ {{> after_hook}}
3
5
 
4
6
  {{#each rendered_children.actionwords}}{{{this}}}
5
7
  {{/each}}{{/indent}}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiptest-publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.9
4
+ version: 0.15.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiptest R&D
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-22 00:00:00.000000000 Z
11
+ date: 2016-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -340,7 +340,8 @@ files:
340
340
  - lib/templates/cucumber/java/actionword.hbs
341
341
  - lib/templates/cucumber/java/actionwords.hbs
342
342
  - lib/templates/cucumber/java/parameter.hbs
343
- - lib/templates/cucumber/javascript/_around_hook.hbs
343
+ - lib/templates/cucumber/javascript/_after_hook.hbs
344
+ - lib/templates/cucumber/javascript/_before_hook.hbs
344
345
  - lib/templates/cucumber/javascript/actionword.hbs
345
346
  - lib/templates/cucumber/javascript/actionwords.hbs
346
347
  - lib/templates/cucumber/parameter.hbs
@@ -1,8 +0,0 @@
1
- this.Around(function (scenario, runScenario) {{#curly}}{{#indent}}
2
- this.actionwords = Object.create(require('{{{ relative_path './actionwords.js' }}}').Actionwords);
3
- runScenario(null, function () {{#curly}}{{#indent}}
4
- this.actionwords = null;
5
- {{/indent}}
6
- {{/curly}});
7
- {{/indent}}
8
- {{/curly}});