hiptest-publisher 0.21.1 → 0.21.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hiptest-publisher/gherkin_adder.rb +14 -2
- data/lib/templates/behat/actionword.hbs +1 -1
- data/lib/templates/behave/actionword.hbs +1 -1
- data/lib/templates/cucumber/actionword.hbs +1 -1
- data/lib/templates/cucumber/java/actionword.hbs +1 -1
- data/lib/templates/cucumber/javascript/actionword.hbs +1 -1
- data/lib/templates/specflow/actionword.hbs +3 -2
- data/lib/templates/specflow/actionwords.hbs +1 -2
- metadata +2 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66d70051b9ee31eb07c62e4b4ee9c4bbaeff4fb5
|
4
|
+
data.tar.gz: 822e1a2c1a0dd0eec767dfcf1041a31dd6d32b82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fb7cca9e673ad882baf35b3df9d99262b4059bdd7c2515db2c805121bb53222c022425fca909aedc28b425f53cc71785b6c1680844d71c142d23051deac8115
|
7
|
+
data.tar.gz: 643a62476439fa765cf00c82127ff115b863013e917947cb2526cea8b4019b00eb5b677f712d5e8bc6e084b5128ded23103e60f737ca8b7e2e896ab6a778c73b
|
@@ -23,6 +23,7 @@ module Hiptest
|
|
23
23
|
if actionword = get_actionword(call)
|
24
24
|
@annotations_counter.increment(actionword, code_annotation(call))
|
25
25
|
actionword.children[:gherkin_pattern] ||= pattern(actionword)
|
26
|
+
actionword.children[:parameters_ordered_by_pattern] ||= order_parameters_by_pattern(actionword)
|
26
27
|
end
|
27
28
|
end
|
28
29
|
end
|
@@ -71,7 +72,7 @@ module Hiptest
|
|
71
72
|
value = all_arguments[missing_parameter_name]
|
72
73
|
prettified << " \"#{value}\""
|
73
74
|
end
|
74
|
-
prettified
|
75
|
+
prettified.strip
|
75
76
|
end
|
76
77
|
|
77
78
|
def pattern(actionword)
|
@@ -95,7 +96,18 @@ module Hiptest
|
|
95
96
|
missing_parameter_names.each do |missing_parameter_name|
|
96
97
|
patterned << " \"(.*)\""
|
97
98
|
end
|
98
|
-
"^#{patterned}$"
|
99
|
+
"^#{patterned.strip}$"
|
100
|
+
end
|
101
|
+
|
102
|
+
def order_parameters_by_pattern(actionword)
|
103
|
+
inline_parameter_names = actionword.children[:name].scan(/\"(.*?)\"/).flatten
|
104
|
+
actionword_parameters = {}
|
105
|
+
actionword.children[:parameters].map {|p| actionword_parameters[p.children[:name]] = p}
|
106
|
+
|
107
|
+
missing_parameter_names = actionword_parameters.keys - inline_parameter_names - @special_params
|
108
|
+
[inline_parameter_names, missing_parameter_names, @special_params].flatten.map do |name|
|
109
|
+
actionword_parameters[name]
|
110
|
+
end.compact
|
99
111
|
end
|
100
112
|
|
101
113
|
def all_valued_arguments_for(call)
|
@@ -2,7 +2,7 @@
|
|
2
2
|
/**
|
3
3
|
* @{{{ rendered_children.gherkin_annotation }}} /{{{ rendered_children.gherkin_pattern }}}/
|
4
4
|
*/
|
5
|
-
public function {{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{{ join rendered_children.
|
5
|
+
public function {{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}){{#curly}}{{#indent}}
|
6
6
|
$this->actionwords->{{{ camelize_lower rendered_children.name }}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}${{{underscore this}}}{{/join}}{{/if}});
|
7
7
|
{{/indent}}
|
8
8
|
{{/curly}}{{/if}}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
{{#if rendered_children.gherkin_used_annotations}}
|
2
2
|
{{#each rendered_children.gherkin_used_annotations}}@{{{downcase this }}}(r'{{#remove_last_character ':'}}{{{ strip_regexp_delimiters rendered_children.gherkin_pattern }}}{{/remove_last_character}}')
|
3
|
-
{{/each}}def impl(context{{#if has_parameters?}}, {{{ join rendered_children.
|
3
|
+
{{/each}}def impl(context{{#if has_parameters?}}, {{{ join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}):{{#indent}}
|
4
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}}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{{#if rendered_children.gherkin_annotation }}
|
2
|
-
{{{ rendered_children.gherkin_annotation }}} /{{{ rendered_children.gherkin_pattern }}}/ do{{#if has_parameters?}} |{{{ join rendered_children.
|
2
|
+
{{{ rendered_children.gherkin_annotation }}} /{{{ rendered_children.gherkin_pattern }}}/ do{{#if has_parameters?}} |{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}|{{/if}}
|
3
3
|
{{#indent}}{{ underscore rendered_children.name }}{{#if has_parameters?}}({{{ join rendered_children.parameters ', '}}}){{/if}}{{/indent}}
|
4
4
|
end
|
5
5
|
{{/if}}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{{#if rendered_children.gherkin_annotation }}@{{{ rendered_children.gherkin_annotation }}}("{{{escape_backslashes_and_double_quotes rendered_children.gherkin_pattern }}}")
|
2
|
-
public void {{{camelize_lower rendered_children.name}}}({{{ join rendered_children.
|
2
|
+
public void {{{camelize_lower rendered_children.name}}}({{{ join rendered_children.parameters_ordered_by_pattern ', '}}}) {{#curly}}{{#indent}}
|
3
3
|
{{{ context.call_prefix }}}.{{{camelize_lower rendered_children.name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{camelize_lower this}}}{{/join}}{{/if}});
|
4
4
|
{{/indent}}
|
5
5
|
{{/curly}}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{{#if rendered_children.gherkin_annotation }}
|
2
|
-
this.{{{ rendered_children.gherkin_annotation }}}(/{{{rendered_children.gherkin_pattern }}}/, function ({{#if rendered_children.parameters}}{{{ join rendered_children.
|
2
|
+
this.{{{ rendered_children.gherkin_annotation }}}(/{{{rendered_children.gherkin_pattern }}}/, function ({{#if rendered_children.parameters}}{{{ join rendered_children.parameters_ordered_by_pattern ', '}}}, {{/if}}callback) {{#curly}}{{#indent}}
|
3
3
|
this.actionwords.{{{camelize_lower rendered_children.name}}}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{underscore this}}}{{/join}}{{/if}});
|
4
4
|
callback();
|
5
5
|
{{/indent}}
|
@@ -1,5 +1,6 @@
|
|
1
|
-
[Given("{{{escape_double_quotes rendered_children.gherkin_pattern }}}"), When("{{{escape_double_quotes rendered_children.gherkin_pattern }}}"), Then("{{{escape_double_quotes rendered_children.gherkin_pattern }}}")]
|
2
|
-
public void {{{ camelize_upper rendered_children.name }}}({{#if has_parameters?}}{{{join rendered_children.
|
1
|
+
{{#if rendered_children.gherkin_annotation }}[Given("{{{escape_double_quotes rendered_children.gherkin_pattern }}}"), When("{{{escape_double_quotes rendered_children.gherkin_pattern }}}"), Then("{{{escape_double_quotes rendered_children.gherkin_pattern }}}")]
|
2
|
+
public void {{{ camelize_upper rendered_children.name }}}({{#if has_parameters?}}{{{join rendered_children.parameters_ordered_by_pattern ', '}}}{{/if}}) {{#curly}}{{#indent}}
|
3
3
|
{{{ context.call_prefix }}}.{{ camelize_upper rendered_children.name }}({{#if has_parameters?}}{{#join raw_parameter_names ', '}}{{{camelize_lower this}}}{{/join}}{{/if}});
|
4
4
|
{{/indent}}
|
5
5
|
{{/curly}}
|
6
|
+
{{/if}}
|
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.21.
|
4
|
+
version: 0.21.2
|
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: 2017-
|
11
|
+
date: 2017-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -214,26 +214,6 @@ dependencies:
|
|
214
214
|
- - "~>"
|
215
215
|
- !ruby/object:Gem::Version
|
216
216
|
version: '0.4'
|
217
|
-
- !ruby/object:Gem::Dependency
|
218
|
-
name: jeweler
|
219
|
-
requirement: !ruby/object:Gem::Requirement
|
220
|
-
requirements:
|
221
|
-
- - ">="
|
222
|
-
- !ruby/object:Gem::Version
|
223
|
-
version: 2.1.1
|
224
|
-
- - "~>"
|
225
|
-
- !ruby/object:Gem::Version
|
226
|
-
version: '2.0'
|
227
|
-
type: :development
|
228
|
-
prerelease: false
|
229
|
-
version_requirements: !ruby/object:Gem::Requirement
|
230
|
-
requirements:
|
231
|
-
- - ">="
|
232
|
-
- !ruby/object:Gem::Version
|
233
|
-
version: 2.1.1
|
234
|
-
- - "~>"
|
235
|
-
- !ruby/object:Gem::Version
|
236
|
-
version: '2.0'
|
237
217
|
description: Provides a command-line tool that generates Java, Python or Ruby code
|
238
218
|
to run the tests.
|
239
219
|
email: contact@hiptest.net
|