cukerail 0.6.2 → 0.6.3
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 +4 -4
- data/lib/cukerail/json.rb +0 -21
- data/lib/cukerail/version.rb +1 -1
- data/lib/json_sender.rb +21 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 643c993ef00efc83f6faf698d87b02e2e73248d0
|
4
|
+
data.tar.gz: ef938045a98fffa050c180a9fcc6bd6549a41096
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f19cc78020397362517e49f5dff3fec52a7af543c3b01ab6cc764816d5b1e1ddd27066ddd7e23d13b2d94960a20f4ec2a3e69b5158f75f9ea2ca933d00d7e52
|
7
|
+
data.tar.gz: 9074945ac747956d7f3735808e7bb1cf76271e6cb74b997f9ea684fe41a590bc53177f049842e8e34f358b6ab93b3ee04c76261fbfc21a2e7f55110c24df1855
|
data/lib/cukerail/json.rb
CHANGED
@@ -2,27 +2,6 @@ module Cukerail
|
|
2
2
|
require 'cucumber/formatter/json'
|
3
3
|
class Json < Cucumber::Formatter::Json
|
4
4
|
class Cucumber::Formatter::Json::Builder
|
5
|
-
def scenario_outline(scenario)
|
6
|
-
# puts 'in scenario outline'
|
7
|
-
@test_case_hash = {
|
8
|
-
id: create_id(scenario) + ';' + (@example_id.gsub(' ','').gsub(',',';')),
|
9
|
-
keyword: scenario.keyword,
|
10
|
-
name: scenario.name + (ENV['OLD_STYLE_OUTLINE_NAMES'] ? ' :: ' : " ") + @example_id,
|
11
|
-
description: scenario.description,
|
12
|
-
line: @row.location.line,
|
13
|
-
type: 'scenario'
|
14
|
-
}
|
15
|
-
tags = []
|
16
|
-
tags += create_tags_array(scenario.tags) unless scenario.tags.empty?
|
17
|
-
tags += @examples_table_tags if @examples_table_tags
|
18
|
-
@test_case_hash[:tags] = tags unless tags.empty?
|
19
|
-
comments = []
|
20
|
-
comments += ::Cucumber::Formatter.create_comments_array(scenario.comments) unless scenario.comments.empty?
|
21
|
-
comments += @examples_table_comments if @examples_table_comments
|
22
|
-
comments += @row_comments if @row_comments
|
23
|
-
@test_case_hash[:comments] = comments unless comments.empty?
|
24
|
-
end
|
25
|
-
|
26
5
|
def examples_table(examples_table)
|
27
6
|
# puts 'in examples table'
|
28
7
|
# We want the row data to be used in making the full scenario name
|
data/lib/cukerail/version.rb
CHANGED
data/lib/json_sender.rb
CHANGED
@@ -47,11 +47,28 @@ module Cukerail
|
|
47
47
|
|
48
48
|
def get_name(scenario)
|
49
49
|
base_name = scenario['name']
|
50
|
-
|
51
|
-
|
52
|
-
|
50
|
+
# We only extrapolate example data for scenario outlines
|
51
|
+
is_scenario_outline = scenario['keyword'].downcase == 'scenario outline' ? true : false
|
52
|
+
if is_scenario_outline
|
53
|
+
# if we have scenario number then we assume this is just a JSON output without our id patch
|
54
|
+
outline_number_str = scenario['id'].split(';').select{|e| e =~/^\d+$/}.first
|
55
|
+
if outline_number_str
|
56
|
+
outline_number = (outline_number_str.to_i) -1
|
57
|
+
else
|
58
|
+
# If we do not find an outline number, then we attempt to extrapolate the example data from the
|
59
|
+
# id if there is any and append to the base name. note: _ before variable means it is not going
|
60
|
+
# to be used
|
61
|
+
_feature, _scenario, example_data = scenario['id'].split(';')
|
62
|
+
unless example_data.nil? && example_data.strip.empty?
|
63
|
+
base_name = if ENV['OLD_STYLE_OUTLINE_NAMES']
|
64
|
+
"#{base_name} :: #{example_data}"
|
65
|
+
else
|
66
|
+
"#{base_name} #{example_data}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
53
70
|
end
|
54
|
-
tags= [scenario['tags']].flatten.compact
|
71
|
+
tags = [scenario['tags']].flatten.compact
|
55
72
|
requirement = tags.select{|t| t['name'] =~/@req/}.map{|t| /@req_(\w+)/.match(t['name'])[1]}.first unless tags.empty?
|
56
73
|
[requirement, base_name, outline_number].join(' ').strip
|
57
74
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cukerail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Small
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|