cucumber_junit_to_json 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 87eb32c819df8f7e29fa5fdd6935d5a29413a496
4
- data.tar.gz: 2610d51b8b5eb6728af43c4e9a77a853b923c066
3
+ metadata.gz: a829c4150152aef62b16eb903e97f7011a8c52f2
4
+ data.tar.gz: 58767616d0be0fc57708e7ff8cc337088f10a14f
5
5
  SHA512:
6
- metadata.gz: 8472085871a65fa942e97684af51e6bee4b8f7e98e9ae4997374648b507f73cbee2280021520fc891fed03b44be86d52a796c8fa96d4229e32c76c6d14e3f1a5
7
- data.tar.gz: f6dc8fafec1915b13d6062edb4a548a1fac1c09004010b24b22f09e67a964bc26acf2ce68d1710512f850c2988b3fbbf4fb0fc8372792ef6596b5955ac488572
6
+ metadata.gz: 8e544d402b53aaf6b1b4fc5a102bdcbaf1093da2e0083ec03cf19f323ac444a048a663131f1eb871b3faca532f2399b07685c8f02479eabb58492943a43eb99b
7
+ data.tar.gz: ee8f0409108fbfbf297eb1eae7af2af6394d6e0b605e3d49ee167d210f8258e0a5abd7aecd11cc42a07c45bbdba977ccb33b24bcf45a42a051752978e618c57b
data/.rubocop.yml CHANGED
@@ -14,7 +14,7 @@ Performance/RegexpMatch:
14
14
  Metrics/PerceivedComplexity:
15
15
  Max: 20
16
16
  MethodLength:
17
- Max: 50
17
+ Max: 60
18
18
  Metrics/ParameterLists:
19
19
  Max: 10
20
20
  Metrics/AbcSize:
@@ -41,6 +41,10 @@ module CucumberJunitToJson
41
41
  json.headings step.table.headings
42
42
  json.rows step.table.rows
43
43
  end
44
+ json.rows step.rows do |row|
45
+ json.cells row.cells
46
+ json.line row.line
47
+ end
44
48
  end
45
49
  json.line step.line
46
50
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Top level module
4
+ module CucumberJunitToJson
5
+ # module for all models
6
+ module Models
7
+ # Abstract representation of a cucumber step table rows attribute
8
+ class Rows
9
+ attr_accessor :cells, :line
10
+ def initialize(cells, line = 0)
11
+ @cells = cells
12
+ @line = line
13
+ end
14
+
15
+ def self.parse(data)
16
+ rows = []
17
+ data.each do |c|
18
+ rows.push(Rows.new(c))
19
+ end
20
+ rows
21
+ end
22
+ end
23
+ end
24
+ end
@@ -4,13 +4,14 @@ require 'similar_text'
4
4
  require_relative 'table'
5
5
  require_relative 'match'
6
6
  require_relative 'result'
7
+ require_relative 'rows'
7
8
  # Top level module
8
9
  module CucumberJunitToJson
9
10
  # module for all models
10
11
  module Models
11
12
  # Abstract representation of a cucumber step attribute
12
13
  class Step
13
- attr_accessor :keyword, :name, :match, :table, :result, :line
14
+ attr_accessor :keyword, :name, :match, :table, :rows, :result, :line
14
15
  def initialize
15
16
  @table = CucumberJunitToJson::Models::Table.new
16
17
  end
@@ -30,6 +31,12 @@ module CucumberJunitToJson
30
31
  # process that table
31
32
  if prev_step_has_table == true
32
33
  steps.last.table = CucumberJunitToJson::Models::Table.parse(table)
34
+ rows = []
35
+ rows.push(steps.last.table.headings)
36
+ steps.last.table.rows.each do |r|
37
+ rows.push(r)
38
+ end
39
+ steps.last.rows = CucumberJunitToJson::Models::Rows.parse(rows)
33
40
  prev_step_has_table = false
34
41
  table = []
35
42
  end
@@ -54,6 +61,12 @@ module CucumberJunitToJson
54
61
  # process it, hence lets do it before we exit this method
55
62
  if prev_step_has_table == true
56
63
  steps.last.table = CucumberJunitToJson::Models::Table.parse(table)
64
+ rows = []
65
+ rows.push(steps.last.table.headings)
66
+ steps.last.table.rows.each do |r|
67
+ rows.push(r)
68
+ end
69
+ steps.last.rows = CucumberJunitToJson::Models::Rows.parse(rows)
57
70
  prev_step_has_table = false
58
71
  table = []
59
72
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Cucumber Junit to Json version module
4
4
  module CucumberJunitToJson
5
- VERSION = '0.1.4'
5
+ VERSION = '0.1.5'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_junit_to_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Voke Ransom Anighoro
@@ -118,6 +118,7 @@ files:
118
118
  - lib/cucumber_junit_to_json/models/feature.rb
119
119
  - lib/cucumber_junit_to_json/models/match.rb
120
120
  - lib/cucumber_junit_to_json/models/result.rb
121
+ - lib/cucumber_junit_to_json/models/rows.rb
121
122
  - lib/cucumber_junit_to_json/models/scenario.rb
122
123
  - lib/cucumber_junit_to_json/models/step.rb
123
124
  - lib/cucumber_junit_to_json/models/table.rb