hiptest-publisher 0.8.1 → 0.8.2

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: 618c29d0a42f60c642935ce57aef0435b3d9a467
4
- data.tar.gz: aaaad289b1f9baab5bc19fbf68813feb7d93f970
3
+ metadata.gz: 44afaaddfce3beb02f0060f1016dd37892405046
4
+ data.tar.gz: 98fde35548107107eb2910ee03f8e16d2acc7595
5
5
  SHA512:
6
- metadata.gz: d1ef56c5eabd8fdc6edcd0d277f4b20a9258a1b516553457174f955cfab8220781e793d3933cde7009609465d7cda6fb5bfe29095a7d461b83d3464af57eb85d
7
- data.tar.gz: 15b5e8b4a2c7d0f8c59f93481bcc2effa3bbb6efd6b76fd759901ffb69035099eb6be224ea16a5a2c8803b96cc237c6c74b8e33c5d496d474794c96172817cdb
6
+ metadata.gz: 7648d4f1d248c51d15ba7b52ae37a31461e1c585373dcc385eda13af2be81085ae927ba0ddcb492b74f43a3f33dbfc47e61d140303f6a8e758a9eefc7be85f8e
7
+ data.tar.gz: 17ef05fe5365c234728b806cb0be90fca26fddb26201f4accca483d00abe3999cf52f2835e04185ecf2b72d9371ffc2a0b9de4c7cbb2726900b81d89d471849b
@@ -82,12 +82,31 @@ module Hiptest
82
82
  end.compact.join("\n")
83
83
  end
84
84
 
85
+ # kept for backward compatibility of customized templates
85
86
  def hh_remove_quotes (context, s, block)
87
+ hh_remove_double_quotes(context, s, block)
88
+ end
89
+
90
+ def hh_remove_double_quotes (context, s, block)
86
91
  s ? s.gsub('"', '') : ""
87
92
  end
88
93
 
94
+ def hh_remove_single_quotes (context, s, block)
95
+ s ? s.gsub('\'', '') : ""
96
+ end
97
+
98
+ # kept for backward compatibility of customized templates
89
99
  def hh_escape_quotes (context, s, block)
90
- s ? s.gsub(/"/, '\\"') : ""
100
+ hh_escape_double_quotes(context, s, block)
101
+ end
102
+
103
+ def hh_escape_double_quotes (context, s, block)
104
+ s ? s.gsub('"', '\\"') : ""
105
+ end
106
+
107
+ def hh_escape_single_quotes (context, s, block)
108
+ # weird \\\\, see http://stackoverflow.com/questions/7074337/why-does-stringgsub-double-content
109
+ s ? s.gsub('\'', "\\\\'") : ""
91
110
  end
92
111
 
93
112
  def hh_comment (context, commenter, block)
@@ -1 +1 @@
1
- {{#join treated_chunks ' + '}}{{#if this.is_variable?}}{{{this.raw.children.name}}}{{else}}"{{{ escape_quotes this.raw.children.value }}}"{{/if}}{{/join}}
1
+ {{#join treated_chunks ' + '}}{{#if this.is_variable?}}{{{this.raw.children.name}}}{{else}}"{{{ escape_double_quotes this.raw.children.value }}}"{{/if}}{{/join}}
@@ -1,4 +1,4 @@
1
- {{#if rendered_children.gherkin_annotation }}@Given("{{{escape_quotes rendered_children.gherkin_pattern }}}")
1
+ {{#if rendered_children.gherkin_annotation }}@Given("{{{escape_double_quotes rendered_children.gherkin_pattern }}}")
2
2
  public void {{{camelize_lower rendered_children.name}}}({{{ join rendered_children.parameters ', '}}}) {{#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}}
@@ -1 +1 @@
1
- {{{ remove_quotes rendered_children.value }}}
1
+ {{{ remove_double_quotes rendered_children.value }}}
@@ -1 +1 @@
1
- "{{#each treated_chunks}}{{#if this.is_variable?}}#{{#curly}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_quotes this.raw.children.value }}}{{/if}}{{/each}}"
1
+ "{{#each treated_chunks}}{{#if this.is_variable?}}#{{#curly}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}"
@@ -1 +1 @@
1
- {{#if variable_names}}String.format({{/if}}"{{#each treated_chunks}}{{#if this.is_variable?}}%s{{else}}{{{ escape_quotes this.raw.children.value }}}{{/if}}{{/each}}"{{#if variable_names}}, {{{join variable_names ', '}}}){{/if}}
1
+ {{#if variable_names}}String.format({{/if}}"{{#each treated_chunks}}{{#if this.is_variable?}}%s{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}"{{#if variable_names}}, {{{join variable_names ', '}}}){{/if}}
@@ -1,4 +1,4 @@
1
- module('{{{ remove_quotes project_name }}}', {{#curly}}
1
+ module('{{{ escape_single_quotes project_name }}}', {{#curly}}
2
2
  setup: function () {{#curly}}
3
3
  this.actionwords = Object.create(Actionwords);
4
4
  {{/curly}}
@@ -1,4 +1,4 @@
1
1
  {{#if has_datasets?}}{{> item_as_function}}
2
- {{{ rendered_children.datatable }}}{{else}}test('{{{ remove_quotes rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}', function () {{#curly}}
2
+ {{{ rendered_children.datatable }}}{{else}}test('{{{ remove_double_quotes rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}', function () {{#curly}}
3
3
  {{> body}}
4
4
  {{/curly}});{{/if}}
@@ -1,3 +1,3 @@
1
- test('{{scenario_name}}: {{{remove_quotes rendered_children.name}}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}', function () {{#curly}}
1
+ test('{{escape_single_quotes scenario_name}}: {{{escape_single_quotes rendered_children.name}}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}', function () {{#curly}}
2
2
  {{{ camelize_lower scenario_name }}}.apply(this, [{{{ join rendered_children.arguments ', ' }}}]);
3
3
  {{/curly}});
@@ -1,8 +1,8 @@
1
- {{#if has_datasets?}}describe('{{remove_quotes rendered_children.name}}', function () {{#curly}}{{#indent}}
1
+ {{#if has_datasets?}}describe('{{escape_single_quotes rendered_children.name}}', function () {{#curly}}{{#indent}}
2
2
  {{> item_as_function}}
3
3
  {{{ rendered_children.datatable }}}
4
4
  {{/indent}}
5
5
  {{/curly}});
6
- {{else}}it('{{{ remove_quotes rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}', function () {{#curly}}
6
+ {{else}}it('{{{ escape_single_quotes rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}', function () {{#curly}}
7
7
  {{> body}}
8
8
  {{/curly}});{{/if}}
@@ -1,3 +1,3 @@
1
- it('{{{remove_quotes rendered_children.name}}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}', function () {{#curly}}
1
+ it('{{{escape_single_quotes rendered_children.name}}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}', function () {{#curly}}
2
2
  {{{ camelize_lower scenario_name }}}.apply(this, [{{{ join rendered_children.arguments ', ' }}}]);
3
3
  {{/curly}});
@@ -1,4 +1,4 @@
1
- describe('{{{ remove_quotes project_name }}}', function () {{#curly}}{{#indent}}
1
+ describe('{{{ escape_single_quotes project_name }}}', function () {{#curly}}{{#indent}}
2
2
  {{> before_each}}
3
3
 
4
4
  {{#each rendered_children.scenarios}}{{{this}}}
@@ -1,4 +1,4 @@
1
- describe('{{{ remove_quotes project_name }}}', function () {{#curly}}{{#indent}}
1
+ describe('{{{ escape_single_quotes project_name }}}', function () {{#curly}}{{#indent}}
2
2
  {{> before_each}}
3
3
 
4
4
  {{> scenario}}
@@ -1,4 +1,4 @@
1
- describe('{{{ remove_quotes project_name }}}', function () {{#curly}}{{#indent}}
1
+ describe('{{{ escape_single_quotes project_name }}}', function () {{#curly}}{{#indent}}
2
2
  {{> before_each}}
3
3
 
4
4
  {{> scenario}}
@@ -1,4 +1,4 @@
1
- describe('{{{ remove_quotes project_name }}}', function () {{#curly}}{{#indent}}
1
+ describe('{{{ escape_single_quotes project_name }}}', function () {{#curly}}{{#indent}}
2
2
  {{> before_each}}
3
3
 
4
4
  {{#each rendered_children.tests}}{{{this}}}
@@ -1 +1 @@
1
- {{#join treated_chunks ' + '}}{{#if this.is_variable?}}String({{{this.raw.children.name}}}){{else}}"{{{ escape_quotes this.raw.children.value }}}"{{/if}}{{/join}}
1
+ {{#join treated_chunks ' + '}}{{#if this.is_variable?}}String({{{this.raw.children.name}}}){{else}}"{{{ escape_double_quotes this.raw.children.value }}}"{{/if}}{{/join}}
@@ -1 +1 @@
1
- "{{#each treated_chunks}}{{#if this.is_variable?}}{{#curly}}${{{camelize_lower this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_quotes this.raw.children.value }}}{{/if}}{{/each}}"
1
+ "{{#each treated_chunks}}{{#if this.is_variable?}}{{#curly}}${{{camelize_lower this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}"
@@ -1 +1 @@
1
- "{{#each treated_chunks}}{{#if this.is_variable?}}%s{{else}}{{{ escape_quotes this.raw.children.value }}}{{/if}}{{/each}}"{{#if variable_names}} % ({{{ join variable_names ', '}}}){{/if}}
1
+ "{{#each treated_chunks}}{{#if this.is_variable?}}%s{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}"{{#if variable_names}} % ({{{ join variable_names ', '}}}){{/if}}
@@ -1 +1 @@
1
- {{#each treated_chunks}}{{#if this.is_variable?}}${{#curly}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_quotes this.raw.children.value }}}{{/if}}{{/each}}
1
+ {{#each treated_chunks}}{{#if this.is_variable?}}${{#curly}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}
@@ -1,5 +1,5 @@
1
- {{#if has_datasets?}}context "{{{ remove_quotes rendered_children.name }}}" do{{#indent}}
1
+ {{#if has_datasets?}}context "{{{ remove_double_quotes rendered_children.name }}}" do{{#indent}}
2
2
  {{> item_as_def}}
3
- {{{ rendered_children.datatable }}}{{/indent}}{{else}}it "{{{ remove_quotes rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}" do
3
+ {{{ rendered_children.datatable }}}{{/indent}}{{else}}it "{{{ remove_double_quotes rendered_children.name }}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}" do
4
4
  {{> body}}{{/if}}
5
5
  end
@@ -1,3 +1,3 @@
1
- it "{{{remove_quotes rendered_children.name}}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}" do
1
+ it "{{{escape_double_quotes rendered_children.name}}}{{#if rendered_children.uid}} (uid:{{{rendered_children.uid}}}){{/if}}" do
2
2
  {{{ underscore scenario_name }}}({{{ join rendered_children.arguments ', ' }}})
3
3
  end
@@ -1 +1 @@
1
- "{{#each treated_chunks}}{{#if this.is_variable?}}#{{#curly}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_quotes this.raw.children.value }}}{{/if}}{{/each}}"
1
+ "{{#each treated_chunks}}{{#if this.is_variable?}}#{{#curly}}{{{this.raw.children.name}}}{{/curly}}{{else}}{{{ escape_double_quotes this.raw.children.value }}}{{/if}}{{/each}}"
@@ -1,4 +1,4 @@
1
- [Given("{{{escape_quotes rendered_children.gherkin_pattern }}}"), When("{{{escape_quotes rendered_children.gherkin_pattern }}}"), Then("{{{escape_quotes rendered_children.gherkin_pattern }}}")]
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
2
  public void {{{ camelize_upper rendered_children.name }}}({{#if has_parameters?}}{{{join rendered_children.parameters ', '}}}{{/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}}
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.8.1
4
+ version: 0.8.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: 2015-12-09 00:00:00.000000000 Z
11
+ date: 2015-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -566,7 +566,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
566
566
  version: '0'
567
567
  requirements: []
568
568
  rubyforge_project:
569
- rubygems_version: 2.4.6
569
+ rubygems_version: 2.4.5
570
570
  signing_key:
571
571
  specification_version: 4
572
572
  summary: Export your tests from Hiptest into executable tests.