hiptest-publisher 0.10.4 → 0.11.0

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: 2f5b9cfe85d266309d74cbabf61034087acb621f
4
- data.tar.gz: 995e88f1b39536e7abb4ee593dc8bf5e09cedc54
3
+ metadata.gz: 9265f5d7fb656ed28ee0fa1c09a38538741bf11e
4
+ data.tar.gz: 5888104486e35517396d17456b8cadc8d512803d
5
5
  SHA512:
6
- metadata.gz: 50bf0d3d7f6375c69d8df240db246e5cf5b31ded4699d16bafeedd8188f1a3996a637c7ebb4de2dd8523c2784979fd65009557c4e913e41e94a5564c8c220984
7
- data.tar.gz: be6710e84171982f8749f1ce6cf0f909ec80bcee4cdd136cd524692473b381638791c0c1aaf350d86bd098b7697e972f2344b25381c1a63af1d331fbea83a34e
6
+ metadata.gz: 7e818f3e3ebfc105196dba8c74b7df0cb10943eb1919b9cd8385cfb5978e4670198703204aa61433ddf1a17bd4a91e473485e25891683a9219a3ad773b90c9c2
7
+ data.tar.gz: ead810b664042eb7a98fab859bc574c92ca0b27e211d9c8b83271461b365e2810bfeccfe84fed6db697d35c6c41ea81d5a50accc278474a8ab00703c91c0dde7
@@ -14,7 +14,7 @@ module Hiptest
14
14
  end
15
15
 
16
16
  def update_calls
17
- @project.each_sub_nodes(Hiptest::Nodes::Scenario, Hiptest::Nodes::Actionword, Hiptest::Nodes::Test) do |item|
17
+ @project.each_sub_nodes(Hiptest::Nodes::Scenario, Hiptest::Nodes::Actionword, Hiptest::Nodes::Test, Hiptest::Nodes::Folder) do |item|
18
18
  @last_annotation = nil
19
19
  item.each_sub_nodes(Hiptest::Nodes::Call) do |call|
20
20
  call.children[:gherkin_text] ||= "#{text_annotation(call)} #{prettified(call)}"
@@ -66,6 +66,18 @@ module Hiptest
66
66
  end
67
67
  end
68
68
 
69
+ def hh_unless(context, condition, block, else_block = nil)
70
+ condition = !condition.empty? if condition.respond_to?(:empty?)
71
+
72
+ if !condition
73
+ block.fn(context)
74
+ elsif else_block
75
+ else_block.fn(context)
76
+ else
77
+ ""
78
+ end
79
+ end
80
+
69
81
  def hh_indent(context, block)
70
82
  indentation = @context[:indentation] || ' '
71
83
  indentation = "\t" if indentation == '\t'
@@ -385,7 +385,7 @@ module Hiptest
385
385
  class Folder < Node
386
386
  attr_reader :uid, :parent_uid, :order_in_parent
387
387
 
388
- def initialize(uid, parent_uid, name, description, tags = [], order_in_parent = 0)
388
+ def initialize(uid, parent_uid, name, description, tags = [], order_in_parent = 0, body = [])
389
389
  super()
390
390
 
391
391
  @uid = uid
@@ -397,7 +397,8 @@ module Hiptest
397
397
  :description => description,
398
398
  :subfolders => [],
399
399
  :scenarios => [],
400
- :tags => tags
400
+ :tags => tags,
401
+ :body => body
401
402
  }
402
403
  end
403
404
 
@@ -27,6 +27,8 @@ module Hiptest
27
27
  walk_relative_item(folder).merge(
28
28
  :self_name => folder.children[:name],
29
29
  :has_tags? => !folder.children[:tags].empty?,
30
+ :has_step? => has_step?(folder),
31
+ :is_empty? => folder.children[:body].empty?
30
32
  )
31
33
  end
32
34
 
@@ -275,7 +275,8 @@ module Hiptest
275
275
  css_first_content(folder, 'name'),
276
276
  css_first_content(folder, 'description'),
277
277
  build_tags(folder),
278
- css_first_content(folder, 'order_in_parent').to_i)
278
+ css_first_content(folder, 'order_in_parent').to_i,
279
+ build_steps(folder))
279
280
  end
280
281
  alias :build_folderSnapshot :build_folder
281
282
 
@@ -10,8 +10,9 @@ public class {{{ clear_extension context.filename }}} {{#curly}}
10
10
  public Actionwords {{{ context.call_prefix }}};
11
11
 
12
12
  [SetUp]
13
- protected void SetUp() {{#curly}}
14
- {{{ context.call_prefix}}} = new Actionwords();
13
+ protected void SetUp() {{#curly}}{{#indent}}
14
+ {{{ context.call_prefix}}} = new Actionwords();{{/indent}}{{#unless is_empty?}}
15
+ {{> body}}{{/unless}}
15
16
  {{/curly}}
16
17
  {{#each rendered_children.scenarios}}{{{this}}}
17
18
  {{/each}}
@@ -1,5 +1,9 @@
1
1
  {{#if has_tags?}}{{join rendered_children.tags ' '}}
2
2
  {{/if}}Feature: {{{ rendered_children.name }}}{{#indent}}
3
3
  {{#if rendered_children.description}}{{#indent}}{{rendered_children.description}}{{/indent}}{{/if}}
4
- {{#each rendered_children.scenarios}}{{{this}}}{{/each}}
4
+ {{#unless is_empty?}}
5
+ Background:{{#indent}}
6
+ {{#each rendered_children.body}}{{{ this }}}
7
+ {{/each}}{{/indent}}
8
+ {{/unless}}{{#each rendered_children.scenarios}}{{{this}}}{{/each}}
5
9
  {{/indent}}
@@ -6,7 +6,12 @@ import junit.framework.TestCase;
6
6
  public class {{{ clear_extension context.filename }}} extends TestCase {{#curly}}
7
7
  {{#indent}}
8
8
  public Actionwords {{{ context.call_prefix }}} = new Actionwords();
9
- {{#each rendered_children.scenarios}}{{{this}}}
9
+ {{#unless is_empty?}}protected void setUp() throws Exception {{#curly}}{{#indent}}
10
+ super.setUp();{{/indent}}
11
+ {{> body}}
12
+ {{/curly}}
13
+
14
+ {{/unless}}{{#each rendered_children.scenarios}}{{{this}}}
10
15
  {{/each}}
11
16
  {{/indent}}
12
17
  {{/curly}}
@@ -3,15 +3,16 @@ package {{{ context.package }}}{{{ relative_package }}};
3
3
  import org.testng.annotations.*;
4
4
  {{#if needs_to_import_actionwords? }}import {{{ context.package }}}.Actionwords;
5
5
  {{/if}}
6
- public class {{{ clear_extension context.filename }}} {{#curly}}
6
+ public class {{{ clear_extension context.filename }}} {{#curly}}{{#indent}}
7
7
 
8
- {{#indent}}public Actionwords {{{ context.call_prefix }}};
8
+ public Actionwords {{{ context.call_prefix }}};
9
9
 
10
10
  @BeforeMethod
11
11
  public void setUp() {{#curly}}
12
- {{#indent}}{{{ context.call_prefix }}} = new Actionwords();{{/indent}}
13
- {{/curly}}{{/indent}}
14
- {{#indent}}{{#each rendered_children.scenarios}}{{{this}}}
12
+ {{#indent}}{{{ context.call_prefix }}} = new Actionwords();{{/indent}}{{#unless is_empty?}}
13
+ {{> body}}{{/unless}}
14
+ {{/curly}}
15
+ {{#each rendered_children.scenarios}}{{{this}}}
15
16
  {{/each}}
16
17
  {{/indent}}
17
18
  {{/curly}}
@@ -1,5 +1,11 @@
1
1
  (function () {{#curly}}{{#indent}}
2
- {{> module_declaration}}
2
+ module('{{{ escape_single_quotes self_name }}}', {{#curly}}{{#indent}}
3
+ setup: function () {{#curly}}{{#indent}}
4
+ this.actionwords = Object.create(Actionwords);{{/indent}}
5
+ {{#unless is_empty?}}{{> body}}
6
+ {{/unless}}{{/curly}}
7
+ {{/indent}}
8
+ {{/curly}});
3
9
 
4
10
  {{#each rendered_children.scenarios}}{{{this}}}
5
11
 
@@ -1,5 +1,8 @@
1
1
  describe('{{{ escape_single_quotes self_name }}}', function () {{#curly}}{{#indent}}
2
- {{> before_each}}
2
+ beforeEach(function () {{#curly}}{{#indent}}
3
+ this.actionwords = Object.create(Actionwords);{{/indent}}
4
+ {{#unless is_empty?}}{{> body}}
5
+ {{/unless}}{{/curly}});
3
6
 
4
7
  {{#each rendered_children.scenarios}}{{{this}}}
5
8
 
@@ -0,0 +1,11 @@
1
+ describe('{{{ escape_single_quotes self_name }}}', function () {{#curly}}{{#indent}}
2
+ beforeEach(function () {{#curly}}{{#indent}}
3
+ this.actionwords = Object.create(require('{{{ relative_path './actionwords.js' }}}').Actionwords);{{/indent}}
4
+ {{#unless is_empty?}}{{> body}}
5
+ {{/unless}}{{/curly}});
6
+
7
+ {{#each rendered_children.scenarios}}{{{this}}}
8
+
9
+ {{/each}}
10
+ {{/indent}}
11
+ {{/curly}});
@@ -3,7 +3,11 @@ require_once(__DIR__.'{{{ relative_path 'Actionwords.php' '/'}}}');
3
3
 
4
4
  class {{{ clear_extension context.filename }}} extends PHPUnit_Framework_TestCase {{#curly}}{{#indent}}
5
5
  public $actionwords;
6
- {{> setup}}
6
+ public function setUp() {{#curly}}{{#indent}}
7
+ $this->actionwords = new Actionwords();{{/indent}}
8
+ {{#unless is_empty?}}
9
+ {{>body}}
10
+ {{/unless}}{{/curly}}
7
11
 
8
12
  {{#each rendered_children.scenarios}}{{this}}
9
13
 
@@ -2,10 +2,11 @@
2
2
  import unittest
3
3
  from actionwords import Actionwords
4
4
 
5
- class Test{{{ camelize self_name }}}(unittest.TestCase):
6
- def setUp(self):
7
- self.actionwords = Actionwords(self)
8
- {{#indent}}
5
+ class Test{{{ camelize self_name }}}(unittest.TestCase):{{#indent}}
6
+ def setUp(self):{{#indent}}
7
+ self.actionwords = Actionwords(self){{/indent}}
8
+ {{#unless is_empty?}}{{> body}}
9
+ {{/unless}}
9
10
  {{#each rendered_children.scenarios}}{{{this}}}
10
11
  {{/each}}
11
12
  {{/indent}}
@@ -2,10 +2,15 @@
2
2
  require 'spec_helper'
3
3
  require_relative '{{{ relative_path 'actionwords' }}}'
4
4
 
5
- describe '{{{ escape_single_quotes self_name }}}' do
6
- include Actionwords
7
- {{#indent}}
8
- {{#each rendered_children.scenarios}}{{{this}}}
5
+ describe '{{{ escape_single_quotes self_name }}}' do{{#indent}}
6
+ include Actionwords
7
+
8
+ {{#unless is_empty?}}before(:each) do{{#indent}}
9
+ {{> body}}
10
+ {{/indent}}
11
+ end
12
+
13
+ {{/unless}}{{#each rendered_children.scenarios}}{{{this}}}
9
14
 
10
15
  {{/each}}
11
16
  {{/indent}}
@@ -3,10 +3,15 @@
3
3
  require 'minitest/autorun'
4
4
  require_relative '{{{ relative_path 'actionwords' }}}'
5
5
 
6
- class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase
7
- include Actionwords
8
- {{#indent}}
9
- {{#each rendered_children.scenarios}}{{{this}}}
6
+ class Test{{{ camelize self_name }}} < MiniTest::Unit::TestCase{{#indent}}
7
+ include Actionwords
8
+
9
+ {{#unless is_empty?}}def setup{{#indent}}
10
+ {{> body}}
11
+ {{/indent}}
12
+ end
13
+
14
+ {{/unless}}{{#each rendered_children.scenarios}}{{{this}}}
10
15
 
11
16
  {{/each}}
12
17
  {{/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.10.4
4
+ version: 0.11.0
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-03-16 00:00:00.000000000 Z
11
+ date: 2016-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -414,6 +414,7 @@ files:
414
414
  - lib/templates/javascript/jasmine/tests.hbs
415
415
  - lib/templates/javascript/list.hbs
416
416
  - lib/templates/javascript/mocha/_before_each.hbs
417
+ - lib/templates/javascript/mocha/folder.hbs
417
418
  - lib/templates/javascript/nullliteral.hbs
418
419
  - lib/templates/javascript/parameter.hbs
419
420
  - lib/templates/javascript/parenthesis.hbs