res 1.2.12 → 1.2.13

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: 5fa3f63bf69641606ead0c84b5f495ee55ec0c84
4
- data.tar.gz: bf4bdb3d3e75bcf7dc67e1fbe7572e4a14742c52
3
+ metadata.gz: 117cc8f2ed1a6ffac5917c3efbd3bfaf81e23bc3
4
+ data.tar.gz: 4f9b940d44b3bf640dd850d085a123af6dfa8cba
5
5
  SHA512:
6
- metadata.gz: 9cfdf0bf42bf29a42febf405efe1ac577592d8e31651e0cae4eb79b9019bf0c33cd9b51996fbc5817f4691432534ce750d8664dcf214621eff7149d9782bf15b
7
- data.tar.gz: ebd752c7a0dd9fdc3067fb4ae0418814be9ad1a94c77dee6657371913c72e2e27221f4bc17977cdcb7ea93bfc950b983d264b58d4f3ea21dabce60c264ad36ce
6
+ metadata.gz: 73f6d37520d29d9629988e18f28da72551abc99f90e77c065ba6bce12286722b7f1261f38e3e4f6d08fa31ec8fe9c4b5352f00c3954d2d6542ae3447a2f5145c
7
+ data.tar.gz: 6610f245ffcd36f2294c9ba61309f0e8e95fea5ea2df26711d8fe15a68b5ff8b8755b44607ca0073be057eb8724e2bc9ad927cf3b777270cc3d47876a3f5c579
@@ -38,8 +38,8 @@ module Res
38
38
  index =0
39
39
  end
40
40
  while i < group_notification.group.examples.count
41
- result[@count][:children] = Array.new unless result[@count].has_key?(:children)
42
- result[@count][:children][index] = {}
41
+ result[@count][:children] = Array.new if !result[@count].has_key?(:children)
42
+ result[@count][:children][index] = Hash.new
43
43
  result[@count][:children][index] = add_result(group_notification.group.examples[i].metadata)
44
44
  index += 1
45
45
  i += 1
@@ -36,7 +36,7 @@ module Res
36
36
  def after_features(features)
37
37
  results = @_features
38
38
  ir = ::Res::IR.new( :started => @_start_time,
39
- :finished => Time.now,
39
+ :finished => Time.now(),
40
40
  :results => results,
41
41
  :type => 'Cucumber' )
42
42
  @io.puts ir.json
@@ -45,7 +45,7 @@ module Res
45
45
  def before_feature(feature)
46
46
  @_feature = {}
47
47
  @_context = {}
48
- @_feature[:started] = Time.now
48
+ @_feature[:started] = Time.now()
49
49
  begin
50
50
  hash = RubyCucumber2.split_uri( feature.location.to_s )
51
51
  @_feature[:file] = hash[:file]
@@ -59,7 +59,7 @@ module Res
59
59
  end
60
60
 
61
61
  def comment_line(comment_line)
62
- @_context[:comments] = [] unless @_context[:comments]
62
+ @_context[:comments] = [] if !@_context[:comments]
63
63
  @_context[:comments] << comment_line
64
64
  end
65
65
 
@@ -67,7 +67,7 @@ module Res
67
67
  end
68
68
 
69
69
  def tag_name(tag_name)
70
- @_context[:tags] = [] unless @_context[:tag]
70
+ @_context[:tags] = [] if !@_context[:tag]
71
71
  # Strip @ from tags
72
72
  @_context[:tags] << tag_name[1..-1]
73
73
  end
@@ -76,7 +76,7 @@ module Res
76
76
  # :name => 'Feature name',
77
77
  # :description => "As a blah\nAs a blah\n" }
78
78
  def feature_name(keyword, name)
79
- @_feature[:type] = "Cucumber::#{keyword.gsub(/\s+/, '')}"
79
+ @_feature[:type] = "Cucumber::" + keyword.gsub(/\s+/, "")
80
80
 
81
81
  lines = name.split("\n")
82
82
  lines = lines.collect { |l| l.strip }
@@ -86,7 +86,7 @@ module Res
86
86
  end
87
87
 
88
88
  def after_feature(feature)
89
- @_feature[:finished] = Time.now
89
+ @_feature[:finished] = Time.now()
90
90
  end
91
91
 
92
92
  def before_feature_element(feature_element)
@@ -104,7 +104,7 @@ module Res
104
104
  @_feature_element[:file] = 'unknown'
105
105
  end
106
106
 
107
- @_feature[:children] = [] unless @_feature[:children]
107
+ @_feature[:children] = [] if ! @_feature[:children]
108
108
 
109
109
  @_feature[:children] << @_feature_element
110
110
  @_context = @_feature_element
@@ -126,7 +126,7 @@ module Res
126
126
  end
127
127
 
128
128
  if fail.compact.empty? and feature_element.respond_to? :status
129
- @_feature_element[:status] = feature_element.status if feature_element.status.to_s != 'skipped'
129
+ @_feature_element[:status] = feature_element.status if feature_element.status.to_s != "skipped"
130
130
  else
131
131
  fail = fail.compact
132
132
  @_feature_element[:status] = fail[0].status
@@ -151,7 +151,7 @@ module Res
151
151
 
152
152
 
153
153
  def scenario_name(keyword, name, file_colon_line, source_indent)
154
- @_context[:type] = "Cucumber::#{keyword.gsub(/\s+/, '')}"
154
+ @_context[:type] = "Cucumber::" + keyword.gsub(/\s+/, "")
155
155
  @_context[:name] = name || ''
156
156
  end
157
157
 
@@ -163,8 +163,8 @@ module Res
163
163
  # to scenario that don't exist
164
164
  return if @_feature_element && @_feature_element[:finished]
165
165
 
166
- @_feature_element = {} unless @_feature_element
167
- @_feature_element[:children] = [] unless @_feature_element[:children]
166
+ @_feature_element = {} if !@_feature_element
167
+ @_feature_element[:children] = [] if !@_feature_element[:children]
168
168
  @_feature_element[:children] << @_step
169
169
  @_context = @_step
170
170
  end
@@ -173,12 +173,12 @@ module Res
173
173
 
174
174
  file_colon_line = args[0] if args[0]
175
175
 
176
- @_step[:type] = 'Cucumber::Step'
176
+ @_step[:type] = "Cucumber::Step"
177
177
  name = keyword + step_match.format_args(lambda{|param| %{#{param}}})
178
178
  @_step[:name] = name
179
179
  @_step[:status] = status
180
180
  #@_step[:background] = background
181
- @_step[:type] = 'Cucumber::Step'
181
+ @_step[:type] = "Cucumber::Step"
182
182
 
183
183
  end
184
184
 
@@ -212,7 +212,7 @@ module Res
212
212
 
213
213
  def before_table_row(table_row)
214
214
  @_current_table_row = { :type => 'Cucumber::ScenarioOutline::Example' }
215
- @_table = [] unless @_table
215
+ @_table = [] if !@_table
216
216
  end
217
217
 
218
218
  def after_table_row(table_row)
@@ -223,12 +223,12 @@ module Res
223
223
  @_current_table_row[:message] = table_row.exception.to_s
224
224
  end
225
225
 
226
- if table_row.status and table_row.status != 'skipped' and table_row.status != nil
226
+ if table_row.status and table_row.status != "skipped" and table_row.status != nil
227
227
  @_current_table_row[:status] = table_row.status
228
228
  end
229
229
 
230
230
  @_current_table_row[:line] = table_row.line
231
- @_current_table_row[:urn] = @_feature_element[:file] + ':' + table_row.line.to_s
231
+ @_current_table_row[:urn] = @_feature_element[:file] + ":" + table_row.line.to_s
232
232
  @_table << @_current_table_row
233
233
  end
234
234
  end
@@ -238,7 +238,7 @@ module Res
238
238
 
239
239
  def table_cell_value(value, status)
240
240
  @_current_table_row[:children] = [] if !@_current_table_row[:children]
241
- @_current_table_row[:children] << { :type => 'Cucumber::ScenarioOutline::Parameter',
241
+ @_current_table_row[:children] << { :type => "Cucumber::ScenarioOutline::Parameter",
242
242
  :name => value, :status => status }
243
243
  end
244
244
 
@@ -21,6 +21,15 @@ module Res
21
21
  status = "failed"
22
22
  status = "passed" if ir.tests.count == ir.count(:passed)
23
23
 
24
+ if ir.values.has_key?('#type') && ir.values['#type'] == 'multiple'
25
+ measures = {}
26
+ ir.values.select { |k, v| k !~ /^[#_]/ }.each do |k, v|
27
+ measures[k] = { :count => v, :total => ir.values['_total'] }
28
+ end
29
+ else
30
+ measures = ir.values
31
+ end
32
+
24
33
  # Set Lion Data
25
34
  lion_data = {
26
35
  :app_name => config.app_name,
@@ -32,10 +41,9 @@ module Res
32
41
  :started => ir.results.first[:started],
33
42
  :finished => ir.results.last[:finished],
34
43
  :status => status,
35
- :measures => ir.values
44
+ :measures => measures
36
45
  }
37
46
 
38
-
39
47
  uri = URI.parse(config.url)
40
48
  @http = Net::HTTP.new(uri.host, uri.port)
41
49
  if config.cert
@@ -14,7 +14,7 @@ module Res
14
14
  config.process(args)
15
15
 
16
16
  @case_status = {}
17
- @io = File.new('./.test_rail_reporter.log','w+')
17
+ @io = File.new("./.test_rail_reporter.log","w+")
18
18
 
19
19
  test_rail_project = config.project
20
20
  @suite_name = config.suite
@@ -35,7 +35,7 @@ module Res
35
35
  @mappings = Res::Mappings.new(@ir.type)
36
36
 
37
37
  suite = @project.find_or_create_suite(:name => @suite_name, :id => @project.id)
38
- @io.puts 'Syncing Suite'
38
+ @io.puts "Syncing Suite"
39
39
 
40
40
  i = 0
41
41
  while i < @ir.results.count
@@ -44,13 +44,13 @@ module Res
44
44
  i += 1
45
45
  end # while
46
46
  @synced = true
47
- @io.puts '> Sync Successful'
47
+ @io.puts "> Sync Successful"
48
48
  end
49
49
 
50
50
  # Submits run against suite
51
51
  # Either creates a new run using run_name or use existing run_id
52
52
  def submit_results(ir, args = {})
53
- sync_tests(ir) unless @synced
53
+ sync_tests(ir) if !@synced
54
54
  suite = @project.find_suite(:name => @suite_name)
55
55
 
56
56
  run_name = @config.run_name || args[:run_name] || nil
@@ -74,9 +74,9 @@ module Res
74
74
  end
75
75
 
76
76
  else
77
- @io.puts '> run_name and run_id are either nil or not specified'
77
+ @io.puts "> run_name and run_id are either nil or not specified"
78
78
  @io.close
79
- return 'run_name and run_id are either nil or not specified'
79
+ return "run_name and run_id are either nil or not specified"
80
80
 
81
81
  end
82
82
 
@@ -94,10 +94,10 @@ module Res
94
94
  end # while
95
95
  end # ifa
96
96
  add_case_status(run_id)
97
- @io.puts '> Added the test case status'
98
- @io.puts '> Submit Successful'
97
+ @io.puts "> Added the test case status"
98
+ @io.puts "> Submit Successful"
99
99
  @io.close
100
- 'Submitted to Test Rail'
100
+ return "Submitted to Test Rail"
101
101
  end
102
102
 
103
103
  def tr
@@ -136,9 +136,11 @@ module Res
136
136
  if @mappings.context.include?(child[:type])
137
137
  section = section.find_section(:name => child[:name])
138
138
  case_details(child, section)
139
+
139
140
  elsif @mappings.case.include?(child[:type])
140
- tcase = section.find_test_case(:title => child[:name]) unless section.nil?
141
- @case_status[:"#{tcase.id}"] = child[:status] unless tcase.nil?
141
+ tcase = section.find_test_case(:title => child[:name]) if !section.nil?
142
+ @case_status[:"#{tcase.id}"] = child[:status] if !tcase.nil?
143
+
142
144
  end
143
145
  end
144
146
  end
@@ -1,3 +1,3 @@
1
1
  module Res
2
- VERSION = '1.2.12'
2
+ VERSION = '1.2.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: res
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.12
4
+ version: 1.2.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - BBC
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-08-30 00:00:00.000000000 Z
13
+ date: 2016-08-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.5.1
131
+ rubygems_version: 2.5.0
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Test Result report libraries