hiptest-publisher 1.29.2 → 1.30.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +5 -5
  2. data/config/locales/en.yml +7 -0
  3. data/lib/config/swift-xctest.conf +18 -0
  4. data/lib/hiptest-publisher.rb +1 -3
  5. data/lib/hiptest-publisher/client.rb +26 -4
  6. data/lib/hiptest-publisher/export_cache.rb +85 -0
  7. data/lib/hiptest-publisher/formatters/reporter.rb +4 -0
  8. data/lib/hiptest-publisher/handlebars_helper.rb +13 -4
  9. data/lib/hiptest-publisher/options_parser.rb +6 -0
  10. data/lib/templates/behat/actionword.hbs +1 -1
  11. data/lib/templates/behat/actionwords.hbs +2 -2
  12. data/lib/templates/behat/library.hbs +2 -2
  13. data/lib/templates/behat/libraryactionword.hbs +1 -1
  14. data/lib/templates/behave/actionword.hbs +2 -2
  15. data/lib/templates/behave/actionwords.hbs +2 -2
  16. data/lib/templates/behave/library.hbs +2 -2
  17. data/lib/templates/behave/libraryactionword.hbs +2 -2
  18. data/lib/templates/common/_gherkin_pattern.hbs +1 -1
  19. data/lib/templates/common/datatable.hbs +2 -2
  20. data/lib/templates/csharp/_body.hbs +1 -1
  21. data/lib/templates/csharp/actionwords.hbs +2 -2
  22. data/lib/templates/csharp/folder.hbs +1 -1
  23. data/lib/templates/csharp/ifthen.hbs +2 -2
  24. data/lib/templates/csharp/scenarios.hbs +1 -1
  25. data/lib/templates/csharp/template.hbs +1 -1
  26. data/lib/templates/csharp/tests.hbs +1 -1
  27. data/lib/templates/csharp/while.hbs +1 -1
  28. data/lib/templates/cucumber/actionwords.hbs +1 -1
  29. data/lib/templates/cucumber/groovy/step-definitions/_gherkin_pattern.hbs +1 -1
  30. data/lib/templates/cucumber/groovy/step-definitions/actionword.hbs +1 -1
  31. data/lib/templates/cucumber/groovy/step-definitions/actionwords.hbs +1 -1
  32. data/lib/templates/cucumber/groovy/step-definitions/library.hbs +1 -1
  33. data/lib/templates/cucumber/groovy/step-definitions/libraryactionword.hbs +1 -1
  34. data/lib/templates/cucumber/java/actionword.hbs +1 -1
  35. data/lib/templates/cucumber/java/actionwords.hbs +1 -1
  36. data/lib/templates/cucumber/javascript/actionword.hbs +1 -1
  37. data/lib/templates/cucumber/javascript/actionwords.hbs +1 -1
  38. data/lib/templates/cucumber/typescript/actionword.hbs +1 -1
  39. data/lib/templates/cucumber/typescript/actionwords.hbs +1 -1
  40. data/lib/templates/cucumber/typescript/library.hbs +1 -1
  41. data/lib/templates/cucumber/typescript/libraryactionword.hbs +1 -1
  42. data/lib/templates/gherkin/_gherkin_text.hbs +1 -1
  43. data/lib/templates/gherkin/_scenario.hbs +2 -2
  44. data/lib/templates/gherkin/datatable.hbs +1 -1
  45. data/lib/templates/gherkin/folder.hbs +3 -3
  46. data/lib/templates/gherkin/single_test.hbs +1 -1
  47. data/lib/templates/gherkin/template.hbs +1 -1
  48. data/lib/templates/groovy/_steps.hbs +1 -1
  49. data/lib/templates/groovy/actionwords.hbs +2 -2
  50. data/lib/templates/groovy/datatable.hbs +1 -1
  51. data/lib/templates/groovy/folder.hbs +2 -2
  52. data/lib/templates/groovy/libraries.hbs +3 -3
  53. data/lib/templates/groovy/library.hbs +2 -2
  54. data/lib/templates/groovy/scenarios.hbs +1 -1
  55. data/lib/templates/groovy/template.hbs +1 -1
  56. data/lib/templates/groovy/tests.hbs +1 -1
  57. data/lib/templates/java/_body.hbs +1 -1
  58. data/lib/templates/java/actionwords.hbs +2 -2
  59. data/lib/templates/java/espresso/folder.hbs +1 -1
  60. data/lib/templates/java/espresso/scenarios.hbs +1 -1
  61. data/lib/templates/java/espresso/tests.hbs +1 -1
  62. data/lib/templates/java/folder.hbs +1 -1
  63. data/lib/templates/java/ifthen.hbs +2 -2
  64. data/lib/templates/java/libraries.hbs +3 -3
  65. data/lib/templates/java/library.hbs +2 -2
  66. data/lib/templates/java/scenarios.hbs +1 -1
  67. data/lib/templates/java/template.hbs +1 -1
  68. data/lib/templates/java/testng/folder.hbs +1 -1
  69. data/lib/templates/java/testng/scenarios.hbs +1 -1
  70. data/lib/templates/java/testng/tests.hbs +1 -1
  71. data/lib/templates/java/tests.hbs +1 -1
  72. data/lib/templates/java/while.hbs +1 -1
  73. data/lib/templates/javascript/_body.hbs +2 -2
  74. data/lib/templates/javascript/actionwords.hbs +2 -2
  75. data/lib/templates/javascript/codeceptjs/actionword.hbs +1 -1
  76. data/lib/templates/javascript/codeceptjs/actionwords.hbs +1 -1
  77. data/lib/templates/javascript/es6/actionwords.hbs +2 -2
  78. data/lib/templates/javascript/folder.hbs +1 -1
  79. data/lib/templates/javascript/ifthen.hbs +2 -2
  80. data/lib/templates/javascript/jasmine/folder.hbs +1 -1
  81. data/lib/templates/javascript/jasmine/scenarios.hbs +1 -1
  82. data/lib/templates/javascript/jasmine/tests.hbs +1 -1
  83. data/lib/templates/javascript/mocha/folder.hbs +1 -1
  84. data/lib/templates/javascript/scenarios.hbs +1 -1
  85. data/lib/templates/javascript/template.hbs +1 -1
  86. data/lib/templates/javascript/tests.hbs +1 -1
  87. data/lib/templates/javascript/while.hbs +1 -1
  88. data/lib/templates/jbehave/_scenario.hbs +1 -1
  89. data/lib/templates/jbehave/folder.hbs +3 -3
  90. data/lib/templates/jbehave/single_test.hbs +1 -1
  91. data/lib/templates/jbehave/steps/_gherkin_pattern.hbs +1 -1
  92. data/lib/templates/jbehave/steps/actionword.hbs +1 -1
  93. data/lib/templates/jbehave/steps/actionwords.hbs +1 -1
  94. data/lib/templates/php/_body.hbs +1 -1
  95. data/lib/templates/php/actionwords.hbs +2 -2
  96. data/lib/templates/php/folder.hbs +1 -1
  97. data/lib/templates/php/ifthen.hbs +2 -2
  98. data/lib/templates/php/libraries.hbs +4 -4
  99. data/lib/templates/php/library.hbs +2 -2
  100. data/lib/templates/php/scenarios.hbs +1 -1
  101. data/lib/templates/php/template.hbs +1 -1
  102. data/lib/templates/php/tests.hbs +1 -1
  103. data/lib/templates/php/while.hbs +1 -1
  104. data/lib/templates/python/_body.hbs +1 -1
  105. data/lib/templates/python/actionwords.hbs +1 -1
  106. data/lib/templates/python/folder.hbs +1 -1
  107. data/lib/templates/python/libraries.hbs +4 -4
  108. data/lib/templates/python/library.hbs +1 -1
  109. data/lib/templates/python/scenarios.hbs +1 -1
  110. data/lib/templates/python/template.hbs +1 -1
  111. data/lib/templates/python/tests.hbs +1 -1
  112. data/lib/templates/python/unittest/actionwords.hbs +1 -1
  113. data/lib/templates/python/while.hbs +1 -1
  114. data/lib/templates/robotframework/_keyword_body.hbs +1 -1
  115. data/lib/templates/robotframework/_scenario.hbs +1 -1
  116. data/lib/templates/robotframework/actionwords.hbs +1 -1
  117. data/lib/templates/robotframework/datatable.hbs +1 -1
  118. data/lib/templates/robotframework/folder.hbs +16 -16
  119. data/lib/templates/robotframework/scenarios.hbs +15 -15
  120. data/lib/templates/robotframework/template.hbs +1 -1
  121. data/lib/templates/robotframework/tests.hbs +2 -2
  122. data/lib/templates/ruby/_body.hbs +1 -1
  123. data/lib/templates/ruby/actionwords.hbs +2 -2
  124. data/lib/templates/ruby/folder.hbs +1 -1
  125. data/lib/templates/ruby/ifthen.hbs +2 -2
  126. data/lib/templates/ruby/minitest/folder.hbs +1 -1
  127. data/lib/templates/ruby/minitest/scenarios.hbs +1 -1
  128. data/lib/templates/ruby/minitest/tests.hbs +1 -1
  129. data/lib/templates/ruby/scenarios.hbs +1 -1
  130. data/lib/templates/ruby/template.hbs +1 -1
  131. data/lib/templates/ruby/tests.hbs +1 -1
  132. data/lib/templates/ruby/while.hbs +1 -1
  133. data/lib/templates/seleniumide/call.hbs +1 -1
  134. data/lib/templates/seleniumide/single_test.hbs +1 -1
  135. data/lib/templates/seleniumide/tests.hbs +1 -1
  136. data/lib/templates/specflow/actionword.hbs +1 -1
  137. data/lib/templates/specflow/actionwords.hbs +2 -2
  138. data/lib/templates/swift/_body.hbs +11 -0
  139. data/lib/templates/swift/_item_as_def.hbs +5 -0
  140. data/lib/templates/swift/_scenario.hbs +7 -0
  141. data/lib/templates/swift/actionword.hbs +1 -0
  142. data/lib/templates/swift/actionwords.hbs +6 -0
  143. data/lib/templates/swift/argument.hbs +1 -0
  144. data/lib/templates/swift/assign.hbs +1 -0
  145. data/lib/templates/swift/binaryexpression.hbs +1 -0
  146. data/lib/templates/swift/call.hbs +2 -0
  147. data/lib/templates/swift/dataset.hbs +4 -0
  148. data/lib/templates/swift/dict.hbs +1 -0
  149. data/lib/templates/swift/field.hbs +1 -0
  150. data/lib/templates/swift/folder.hbs +23 -0
  151. data/lib/templates/swift/ifthen.hbs +7 -0
  152. data/lib/templates/swift/index.hbs +1 -0
  153. data/lib/templates/swift/list.hbs +1 -0
  154. data/lib/templates/swift/parameter.hbs +1 -0
  155. data/lib/templates/swift/parenthesis.hbs +1 -0
  156. data/lib/templates/swift/project.hbs +2 -0
  157. data/lib/templates/swift/property.hbs +1 -0
  158. data/lib/templates/swift/scenario.hbs +1 -0
  159. data/lib/templates/swift/scenarios.hbs +25 -0
  160. data/lib/templates/swift/single_scenario.hbs +24 -0
  161. data/lib/templates/swift/single_test.hbs +23 -0
  162. data/lib/templates/swift/step.hbs +1 -0
  163. data/lib/templates/swift/stringliteral.hbs +1 -0
  164. data/lib/templates/swift/symbol.hbs +1 -0
  165. data/lib/templates/swift/tag.hbs +1 -0
  166. data/lib/templates/swift/template.hbs +1 -0
  167. data/lib/templates/swift/test.hbs +1 -0
  168. data/lib/templates/swift/tests.hbs +25 -0
  169. data/lib/templates/swift/while.hbs +5 -0
  170. data/lib/templates/typescript/actionwords.hbs +1 -1
  171. data/lib/templates/typescript/libraries.hbs +4 -4
  172. data/lib/templates/typescript/library.hbs +1 -1
  173. metadata +73 -40
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e46a8377ebb5194adc0952ea548e76247f71a935
4
- data.tar.gz: 50191888c1dd19ae3118ca0d0857cc81608343b4
2
+ SHA256:
3
+ metadata.gz: e51e585e6cfddfb427d0ce4d5ccd898d812072b5def6ada9ac19eb2ebfec7b07
4
+ data.tar.gz: d23a1a44229b281b0ae4a6ab8d561923f35d99fc3bba9cd5ad546217363f2a6a
5
5
  SHA512:
6
- metadata.gz: af82fded9be8f62cb73c6c02a680bfed6f22a2852dfdc4da225a57d8de4076a634e334bc813d4aefafbed1eaaf16e16e1ca2ab696dd81aa749e3e59a680e9970
7
- data.tar.gz: c00061e41e5ef13453fc152b8c51b219da654d442b94e0be10134041250e7f72c3231e52bafd9351a6b19d65579b62dfcd115a35feb7cb6d320ea3b8fd71c652
6
+ metadata.gz: ecb76a6be315f0ccc199e52708fcd9df128f04d1b3c0d66fd1327d09360b5975d3414887af2950f82ebda04581e0139307a014e7d869cf1a78102d77e23c66ed
7
+ data.tar.gz: 3cae8f924fefc9bc926a6cee22463f3abfbd9afc917c9ae12d51e3baecd23927ef51d654cafba4f1db7442644a8f9d975f4cf055b6ab9477974f484441ce53bf
@@ -117,6 +117,8 @@ en:
117
117
  default: |
118
118
  An error has occured, sorry for the inconvenience.
119
119
  Try running the command again with --verbose for detailed output
120
+ export_cache:
121
+ cache_dir_not_creatable: Unable to create directory %{cache_dir}
120
122
  invalid_config_file: cannot find configuration file in "%{hiptest_publisher_path}/lib/config" for language %{language} and framework %{framework}
121
123
  invalid_config_file_no_framework: cannot find configuration file in "%{hiptest_publisher_path}/lib/config" for language %{language}
122
124
  invalid_node: Invalid node_name %{name} in language group [%{group_name}]
@@ -129,6 +131,9 @@ en:
129
131
  test_run_list_unavailable: Cannot get the list of available test runs from HipTest. Try using --test-run-id instead of --test-run-name
130
132
  exporting_file: Exporting %{name}
131
133
  fetching_data: Fetching data from HipTest
134
+ using_cached_data: Using cached data from previous export
135
+ caching_data: Caching data
136
+ using_cache: "Using cache: %{full_path}"
132
137
  help:
133
138
  categories:
134
139
  title: For language %{language}, available file groups are
@@ -206,6 +211,8 @@ en:
206
211
  with_folders: Use folders hierarchy to export files in respective directories
207
212
  without: Exclude file categories from import (--only=list to list them)
208
213
  xml_file: XML file to use instead of fetching it from HipTest
214
+ cache_dir: "Path to the directory to store cache of Hiptest data"
215
+ cache_duration: "Validity of the Hiptest data cache in seconds"
209
216
  overwrite:
210
217
  ask_confirmation: 'File %{path} exists, do you want to overwrite it? [y/N] '
211
218
  warning_message: File %{path} already exists, skipping. Use --force to overwrite it.
@@ -0,0 +1,18 @@
1
+ [_common]
2
+ template_dirs = swift, common
3
+ indentation = ' '
4
+ comment = '//'
5
+
6
+ [tests]
7
+ filename = 'ProjectUITests.swift'
8
+ named_filename = '%sUITest.swift'
9
+ filename_convention = 'camelize'
10
+ naming_convention = 'camelize'
11
+ call_prefix = 'app'
12
+ comment = '//'
13
+
14
+ [actionwords]
15
+ filename = 'Actionwords.swift'
16
+ naming_convention = 'camelize'
17
+ call_prefix = 'this'
18
+ comment = '//'
@@ -83,9 +83,7 @@ module Hiptest
83
83
  end
84
84
 
85
85
  def fetch_xml_file
86
- reporter.with_status_message I18n.t(:fetching_data) do
87
- @client.fetch_project_export
88
- end
86
+ @client.fetch_project_export
89
87
  rescue ClientError => err
90
88
  # This should not be an error that needs reporting to an exception monitoring app
91
89
  puts err.message.yellow
@@ -4,6 +4,7 @@ require 'json'
4
4
  require 'net/http'
5
5
  require 'uri'
6
6
 
7
+ require_relative 'export_cache'
7
8
  require_relative 'formatters/reporter'
8
9
 
9
10
  module Hiptest
@@ -72,11 +73,25 @@ module Hiptest
72
73
  end
73
74
 
74
75
  def fetch_project_export
75
- response = send_get_request(url)
76
- if response.code_type == Net::HTTPNotFound
77
- raise ClientError, I18n.t('errors.project_not_found')
76
+ cached = export_cache.cache_for(url)
77
+
78
+ unless cached.nil?
79
+ @reporter.with_status_message I18n.t(:using_cached_data) do
80
+ return cached
81
+ end
82
+ end
83
+
84
+ @reporter.with_status_message I18n.t(:fetching_data) do
85
+ response = send_get_request(url)
86
+ if response.code_type == Net::HTTPNotFound
87
+ raise ClientError, I18n.t('errors.project_not_found')
88
+ end
89
+
90
+ content = response.body
91
+ export_cache.cache(url, content)
92
+
93
+ return content
78
94
  end
79
- response.body
80
95
  end
81
96
 
82
97
  def available_test_runs
@@ -108,6 +123,13 @@ module Hiptest
108
123
 
109
124
  private
110
125
 
126
+ def export_cache
127
+ @export_cache ||= ExportCache.new(
128
+ @cli_options.cache_dir,
129
+ @cli_options.cache_duration,
130
+ reporter: @reporter)
131
+ end
132
+
111
133
  def test_run_id
112
134
  return unless cli_options.test_run_id? || cli_options.test_run_name?
113
135
 
@@ -0,0 +1,85 @@
1
+ require 'i18n'
2
+
3
+ require_relative 'formatters/reporter'
4
+ require_relative 'file_writer'
5
+
6
+
7
+ module Hiptest
8
+ class ExportCache
9
+ def initialize(cache_dir, cache_duration, reporter: nil)
10
+ @cache_dir = cache_dir
11
+ @cache_duration = cache_duration
12
+ @reporter = reporter || Reporter.new
13
+
14
+ clear_cache
15
+ end
16
+
17
+ def cache(url, content, date: nil)
18
+ return if @cache_duration <= 0
19
+
20
+ date ||= Time.now
21
+ filename = "#{Digest::MD5.hexdigest(url)}-#{date.to_i}"
22
+
23
+ file_writer.write_to_file(File.join(@cache_dir, filename), I18n.t("caching_data")) { content }
24
+ end
25
+
26
+ def cache_for(url)
27
+ return if @cache_duration <= 0
28
+
29
+ hashed_url = Digest::MD5.hexdigest(url)
30
+ expiry_date = (Time.now - @cache_duration).to_i
31
+
32
+ cached_filename = cached_filenames
33
+ .select do |filename |
34
+ filename.start_with?("#{hashed_url}-") && !expired?(filename, expiry_date)
35
+ end
36
+ .sort do | f1, f2|
37
+ timestamp_from_filename(f1) <=> timestamp_from_filename(f2)
38
+ end
39
+ .last
40
+
41
+ return nil if cached_filename.nil?
42
+
43
+ full_path = File.join(@cache_dir, cached_filename)
44
+ @reporter.show_verbose_message(I18n.t(:using_cache, full_path: full_path))
45
+ File.read(full_path)
46
+ end
47
+
48
+ def clear_cache
49
+ expired_files.map do |filename|
50
+ FileUtils.rm(File.join(@cache_dir, filename))
51
+ end
52
+ end
53
+
54
+ private
55
+
56
+ def file_writer
57
+ FileWriter.new(@reporter)
58
+ end
59
+
60
+ def expired_files
61
+ expiry_date = (Time.now - @cache_duration).to_i
62
+
63
+ cached_filenames.select do |filename |
64
+ expired?(filename, expiry_date)
65
+ end
66
+ end
67
+
68
+ def cached_filenames
69
+ Dir
70
+ .entries(@cache_dir)
71
+ .select { |entry| File.file?(File.join(@cache_dir, entry)) }
72
+ rescue Errno::ENOENT => err
73
+ []
74
+ end
75
+
76
+ def expired?(filename, expiry_date)
77
+ timestamp_from_filename(filename) < expiry_date
78
+ end
79
+
80
+ def timestamp_from_filename(filename)
81
+ m = filename.match(/\A[a-f0-9]{32}-(\d+)\Z/)
82
+ m.nil? ? nil : m[1].to_i
83
+ end
84
+ end
85
+ end
@@ -51,6 +51,10 @@ class Reporter
51
51
  end
52
52
 
53
53
  class NullReporter
54
+ def with_status_message(message, &blk)
55
+ yield
56
+ end
57
+
54
58
  def method_missing(*args)
55
59
  end
56
60
  end
@@ -42,9 +42,14 @@ module Hiptest
42
42
 
43
43
  def register_custom_helpers
44
44
  self.class.instance_methods.each do |method_name|
45
- next unless method_name.to_s.start_with? 'hh_'
46
- @handlebars.register_helper(method_name.to_s.gsub(/hh_/, '')) do |*args|
47
- send(method_name, *args)
45
+ if method_name.to_s.start_with? 'hh_'
46
+ @handlebars.register_helper(method_name.to_s.gsub(/hh_/, '')) do |*args|
47
+ send(method_name, *args)
48
+ end
49
+ elsif method_name.to_s.start_with? 'as_hh_'
50
+ @handlebars.register_as_helper(method_name.to_s.gsub(/as_hh_/, '')) do |*args|
51
+ send(method_name, *args)
52
+ end
48
53
  end
49
54
  end
50
55
  end
@@ -59,6 +64,10 @@ module Hiptest
59
64
  end
60
65
 
61
66
  def hh_join(context, items, joiner, block, else_block = nil)
67
+ as_hh_join(context, items, joiner, :this, block, else_block)
68
+ end
69
+
70
+ def as_hh_join(context, items, joiner, name, block, else_block = nil)
62
71
  joiner = joiner.to_s
63
72
  joiner.gsub!(/\\t/, "\t")
64
73
  joiner.gsub!(/\\n/, "\n")
@@ -71,7 +80,7 @@ module Hiptest
71
80
  end
72
81
 
73
82
  items.map do |item|
74
- context.with_temporary_context(this: item) do
83
+ context.with_temporary_context(name => item) do
75
84
  block.fn(context)
76
85
  end
77
86
  end.join(joiner)
@@ -223,6 +223,8 @@ class OptionsParser
223
223
  Option.new(nil, 'only=CATEGORIES', nil, String, I18n.t('options.only'), :only),
224
224
  Option.new(nil, 'without=CATEGORIES', nil, String, I18n.t('options.without'), :without),
225
225
  Option.new('x', 'xml-file=PROJECT_XML', nil, String, I18n.t('options.xml_file'), :xml_file),
226
+ Option.new(nil, 'cache-dir=PATH', self.default_cache_directory, String, I18n.t('options.cache_dir'), :cache_dir),
227
+ Option.new(nil, 'cache-duration=DURATION', 60, Integer, I18n.t('options.cache_duration'), :cache_duration),
226
228
  Option.new(nil, 'tests-only', false, nil, I18n.t('options.tests_only'), :tests_only),
227
229
  Option.new(nil, 'actionwords-only', false, nil, I18n.t('options.actionwords_only'), :actionwords_only),
228
230
  Option.new(nil, 'actionwords-signature', false, nil, I18n.t('options.actionwords_signature'), :actionwords_signature),
@@ -265,6 +267,10 @@ class OptionsParser
265
267
  ]
266
268
  end
267
269
 
270
+ def self.default_cache_directory
271
+ File.join(Dir.home, '.hiptest-publisher', 'cache')
272
+ end
273
+
268
274
  def self.parse(args, reporter)
269
275
  options = CliOptions.new
270
276
  opt_parser = OptionParser.new do |opts|
@@ -3,6 +3,6 @@
3
3
  * @{{{ rendered_children.gherkin_annotation }}} /{{> gherkin_pattern}}/
4
4
  */
5
5
  public function {{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}){{#curly}}{{#indent}}
6
- $this->actionwords->{{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}${{{underscore this}}}{{/join}}{{/if}});
6
+ $this->actionwords->{{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}${{{underscore param}}}{{/join}}{{/if}});
7
7
  {{/indent}}
8
8
  {{/curly}}{{/if}}
@@ -10,7 +10,7 @@ class FeatureContext implements SnippetAcceptingContext {{#curly}}{{#indent}}
10
10
  public function __construct() {{#curly}}{{#indent}}
11
11
  $this->actionwords = new Actionwords();{{/indent}}
12
12
  {{/curly}}
13
- {{#each rendered_children.actionwords}}
14
- {{{this}}}{{/each}}{{/indent}}
13
+ {{#each rendered_children.actionwords as |actionword|}}
14
+ {{{actionword}}}{{/each}}{{/indent}}
15
15
  {{/curly}}
16
16
  ?>
@@ -10,7 +10,7 @@ class {{camelize rendered_children.name}}FeatureContext implements SnippetAccept
10
10
  public function __construct() {{#curly}}{{#indent}}
11
11
  $this->actionwords = new Actionwords();{{/indent}}
12
12
  {{/curly}}
13
- {{#each rendered_children.library_actionwords}}
14
- {{{this}}}{{/each}}{{/indent}}
13
+ {{#each rendered_children.library_actionwords as |actionword|}}
14
+ {{{actionword}}}{{/each}}{{/indent}}
15
15
  {{/curly}}
16
16
  ?>
@@ -3,6 +3,6 @@
3
3
  * @{{{ rendered_children.gherkin_annotation }}} /{{> gherkin_pattern}}/
4
4
  */
5
5
  public function {{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}){{#curly}}{{#indent}}
6
- $this->actionwords->get{{{camelize library_name}}}Library()->{{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}${{{underscore this}}}{{/join}}{{/if}});
6
+ $this->actionwords->get{{{camelize library_name}}}Library()->{{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}${{{underscore param}}}{{/join}}{{/if}});
7
7
  {{/indent}}
8
8
  {{/curly}}{{/if}}
@@ -1,4 +1,4 @@
1
1
  {{#if rendered_children.gherkin_used_annotations}}
2
- {{#each rendered_children.gherkin_used_annotations}}@{{{downcase this }}}(r'{{#remove_last_character ':'}}{{#escape_single_quotes}}{{#strip_regexp_delimiters}}{{> gherkin_pattern}}{{/strip_regexp_delimiters}}{{/escape_single_quotes}}{{/remove_last_character}}')
2
+ {{#each rendered_children.gherkin_used_annotations as |annotation|}}@{{{downcase annotation }}}(r'{{#remove_last_character ':'}}{{#escape_single_quotes}}{{#strip_regexp_delimiters}}{{> gherkin_pattern}}{{/strip_regexp_delimiters}}{{/escape_single_quotes}}{{/remove_last_character}}')
3
3
  {{/each}}def impl(context{{#if has_parameters?}}, {{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}):{{#indent}}
4
- context.actionwords.{{{ underscore rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{#replace "__datatable" "context.table"}}{{#replace "__free_text" "context.text"}}{{{underscore this}}}{{/replace}}{{/replace}}{{/join}}{{/if}}){{/indent}}{{/if}}
4
+ context.actionwords.{{{ underscore rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{#replace "__datatable" "context.table"}}{{#replace "__free_text" "context.text"}}{{{underscore param}}}{{/replace}}{{/replace}}{{/join}}{{/if}}){{/indent}}{{/if}}
@@ -7,6 +7,6 @@ from behave import *
7
7
  # context.actionwords = Actionwords()
8
8
 
9
9
  use_step_matcher('re')
10
- {{#each rendered_children.sorted_actionwords}}
11
- {{{this}}}
10
+ {{#each rendered_children.sorted_actionwords as |actionword|}}
11
+ {{{ actionword }}}
12
12
  {{/each}}
@@ -2,6 +2,6 @@ from behave import *
2
2
 
3
3
 
4
4
  use_step_matcher('re')
5
- {{#each rendered_children.library_actionwords}}
6
- {{{this}}}
5
+ {{#each rendered_children.library_actionwords as |actionword|}}
6
+ {{{ actionword }}}
7
7
  {{/each}}
@@ -1,4 +1,4 @@
1
1
  {{#if rendered_children.gherkin_used_annotations}}
2
- {{#each rendered_children.gherkin_used_annotations}}@{{{downcase this }}}(r'{{#remove_last_character ':'}}{{#escape_single_quotes}}{{#strip_regexp_delimiters}}{{> gherkin_pattern}}{{/strip_regexp_delimiters}}{{/escape_single_quotes}}{{/remove_last_character}}')
2
+ {{#each rendered_children.gherkin_used_annotations as |annotation|}}@{{{downcase annotation }}}(r'{{#remove_last_character ':'}}{{#escape_single_quotes}}{{#strip_regexp_delimiters}}{{> gherkin_pattern}}{{/strip_regexp_delimiters}}{{/escape_single_quotes}}{{/remove_last_character}}')
3
3
  {{/each}}def impl(context{{#if has_parameters?}}, {{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}):{{#indent}}
4
- context.actionwords.get{{capitalize library_name}}Library().{{{ underscore rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{#replace "__datatable" "context.table"}}{{#replace "__free_text" "context.text"}}{{{underscore this}}}{{/replace}}{{/replace}}{{/join}}{{/if}}){{/indent}}{{/if}}
4
+ context.actionwords.get{{capitalize library_name}}Library().{{{ underscore rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', ' as |param|}}{{#replace "__datatable" "context.table"}}{{#replace "__free_text" "context.text"}}{{{underscore param}}}{{/replace}}{{/replace}}{{/join}}{{/if}}){{/indent}}{{/if}}
@@ -1 +1 @@
1
- ^{{#strip}}{{#join chunks context.parameter_delimiter}}{{this.value}}{{/join}}{{#each extra_inlined_parameters}} {{context.parameter_delimiter}}{{this.value}}{{context.parameter_delimiter}}{{/each}}{{/strip}}$
1
+ ^{{#strip}}{{#join chunks context.parameter_delimiter as |treated_chunk|}}{{treated_chunk.value}}{{/join}}{{#each extra_inlined_parameters as |param|}} {{context.parameter_delimiter}}{{param.value}}{{context.parameter_delimiter}}{{/each}}{{/strip}}$
@@ -1,3 +1,3 @@
1
- {{#each rendered_children.datasets}}
2
- {{{this}}}
1
+ {{#each rendered_children.datasets as |dataset|}}
2
+ {{{ dataset }}}
3
3
  {{/each}}
@@ -1,5 +1,5 @@
1
1
  {{#indent}}
2
- {{#each rendered_children.body}}{{{this}}}
2
+ {{#each rendered_children.body as |child|}}{{{child}}}
3
3
  {{/each}}
4
4
  {{#if has_step?}}throw new NotImplementedException();{{/if}}
5
5
  {{/indent}}
@@ -1,8 +1,8 @@
1
1
  namespace {{{ context.namespace }}} {{#curly}}{{#indent}}
2
2
 
3
3
  public class Actionwords {{#curly}}{{#indent}}
4
- {{#each rendered_children.actionwords}}
5
- {{{this}}}
4
+ {{#each rendered_children.actionwords as |actionword|}}
5
+ {{{actionword}}}
6
6
  {{/each}}
7
7
  {{/indent}}
8
8
  {{/curly}}
@@ -14,7 +14,7 @@ protected void SetUp() {{#curly}}{{#indent}}
14
14
  {{{ context.call_prefix}}} = new Actionwords();{{/indent}}{{#unless is_empty?}}
15
15
  {{> body}}{{/unless}}
16
16
  {{/curly}}
17
- {{#each rendered_children.scenarios}}{{{this}}}
17
+ {{#each rendered_children.scenarios as |scenario|}}{{{scenario}}}
18
18
  {{/each}}
19
19
  {{/indent}}
20
20
  {{/curly}}
@@ -1,7 +1,7 @@
1
1
  if ({{{ rendered_children.condition }}}) {{#curly}}
2
- {{#indent}}{{#each rendered_children.then}}{{{this}}}
2
+ {{#indent}}{{#each rendered_children.then as |then_statement|}}{{{then_statement}}}
3
3
  {{/each}}{{/indent}}
4
4
  {{#if has_else?}}} else {
5
- {{#indent}}{{#each rendered_children.else}}{{{this}}}
5
+ {{#indent}}{{#each rendered_children.else as |else_statement|}}{{{else_statement}}}
6
6
  {{/each}}{{/indent}}
7
7
  {{/if}}{{/curly}}
@@ -12,7 +12,7 @@ public Actionwords {{{ context.call_prefix }}};
12
12
  protected void SetUp() {{#curly}}
13
13
  {{{ context.call_prefix}}} = new Actionwords();
14
14
  {{/curly}}
15
- {{#each rendered_children.scenarios}}{{{this}}}
15
+ {{#each rendered_children.scenarios as |scenario|}}{{{scenario}}}
16
16
  {{/each}}
17
17
  {{/indent}}
18
18
  {{/curly}}
@@ -1 +1 @@
1
- {{#join treated_chunks ' + '}}{{#if this.is_variable?}}{{{this.raw.children.name}}}{{else}}"{{{ escape_double_quotes this.raw.children.value }}}"{{/if}}{{else}}""{{/join}}
1
+ {{#join treated_chunks ' + ' as |treated_chunk|}}{{#if treated_chunk.is_variable?}}{{{treated_chunk.raw.children.name}}}{{else}}"{{{ escape_double_quotes treated_chunk.raw.children.value }}}"{{/if}}{{else}}""{{/join}}
@@ -7,7 +7,7 @@ using NUnit.Framework;
7
7
  public class {{{ clear_extension context.filename }}} {{#curly}}
8
8
  {{#indent}}
9
9
  public Actionwords {{{ context.call_prefix }}} = new Actionwords();
10
- {{#each rendered_children.tests}}{{{this}}}
10
+ {{#each rendered_children.tests as |test|}}{{{test}}}
11
11
  {{/each}}
12
12
  {{/indent}}
13
13
  {{/curly}}
@@ -1,4 +1,4 @@
1
1
  while ({{{ rendered_children.condition }}}) {{#curly}}{{#indent}}
2
- {{#each rendered_children.body}}{{{this}}}
2
+ {{#each rendered_children.body as |statement|}}{{{statement}}}
3
3
  {{/each}}{{/indent}}
4
4
  {{/curly}}