cucumber_junit_to_json 0.1.2 → 0.1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeec7ff6a8e9c51701503f9f4f9d8cfca47a8f46
|
4
|
+
data.tar.gz: fd60019eb42a76e83fcbd4af4d72ac57617083e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb8b7191931ef0cb73ee20d7cbae276189414b3fc8dff6a8d05f0b4c0132995f13e51b27dded5bf85211abebb87347d9973973f7a248af7e31111c227b850a96
|
7
|
+
data.tar.gz: 8ccd726ef10fddea9c687ad7a5ae6596df7ca70fec763ef35c4cf6aec7c3df59674c949080604482db7d773f46527fee6023a384ef3d8e4383a09498412ff321
|
@@ -35,7 +35,6 @@ module CucumberJunitToJson
|
|
35
35
|
@feature_parser = CucumberJunitToJson::Parsers::FeatureParser.new(options.feature_dir)
|
36
36
|
output_file = options.output_file || 'cucumber.json'
|
37
37
|
features = []
|
38
|
-
puts output_file
|
39
38
|
unless File.file?(output_file)
|
40
39
|
output_directory = File.dirname(output_file)
|
41
40
|
FileUtils.mkdir_p(output_directory) unless File.directory?(output_directory)
|
@@ -82,8 +81,8 @@ module CucumberJunitToJson
|
|
82
81
|
scenario = CucumberJunitToJson::Models::Scenario.new
|
83
82
|
# Removing scenario outline added blob gives you the actual scenario name
|
84
83
|
scenario.name = testcase['name'].split('-- @').first.strip
|
85
|
-
scenario.tags, scenario.line = @feature_parser.tags_and_line_number_matching(feature_uri, scenario.name
|
86
|
-
scenario_line_text = @feature_parser.text_and_line_number_matching(feature_uri, scenario.name
|
84
|
+
scenario.tags, scenario.line = @feature_parser.tags_and_line_number_matching(feature_uri, scenario.name)
|
85
|
+
scenario_line_text = @feature_parser.text_and_line_number_matching(feature_uri, scenario.name).first
|
87
86
|
scenario.keyword = scenario_line_text.split(':').first.strip
|
88
87
|
scenario.type = 'scenario'
|
89
88
|
scenario.uri = feature_uri
|
@@ -68,7 +68,7 @@ module CucumberJunitToJson
|
|
68
68
|
if line =~ /<\S+>/
|
69
69
|
# A match percentage greater than 80 is an indication
|
70
70
|
# of a good match for scenarios
|
71
|
-
found_scenario = true if line.similar(scenario) >=
|
71
|
+
found_scenario = true if line.similar(scenario) >= 76
|
72
72
|
elsif line =~ /#{scenario}/
|
73
73
|
found_scenario = true
|
74
74
|
end
|
@@ -17,8 +17,8 @@ module CucumberJunitToJson
|
|
17
17
|
@path_to_features = path_to_features
|
18
18
|
end
|
19
19
|
|
20
|
-
def tags_and_line_number_matching(file, text
|
21
|
-
tags, line = text_and_line_number_before_match(file, text
|
20
|
+
def tags_and_line_number_matching(file, text)
|
21
|
+
tags, line = text_and_line_number_before_match(file, text)
|
22
22
|
tag_objects = []
|
23
23
|
tags.split(' ').each do |tag|
|
24
24
|
if tag.strip.start_with?('@')
|
@@ -28,14 +28,14 @@ module CucumberJunitToJson
|
|
28
28
|
[tag_objects, line]
|
29
29
|
end
|
30
30
|
|
31
|
-
def text_and_line_number_before_match(file, text
|
31
|
+
def text_and_line_number_before_match(file, text)
|
32
32
|
count = 0
|
33
33
|
prev_line_text = ''
|
34
34
|
File.open(file, 'r') do |f|
|
35
35
|
f.each_line do |line|
|
36
36
|
count += 1
|
37
|
-
if
|
38
|
-
return prev_line_text, count if line.similar(text) >=
|
37
|
+
if line =~ /<\S+>/
|
38
|
+
return prev_line_text, count if line.similar(text) >= 76
|
39
39
|
elsif line =~ /#{text}/
|
40
40
|
return prev_line_text, count
|
41
41
|
end
|
@@ -45,13 +45,13 @@ module CucumberJunitToJson
|
|
45
45
|
raise Error, "Could not find #{text} in #{file}"
|
46
46
|
end
|
47
47
|
|
48
|
-
def text_and_line_number_matching(file, text
|
48
|
+
def text_and_line_number_matching(file, text)
|
49
49
|
count = 0
|
50
50
|
File.open(file, 'r') do |f|
|
51
51
|
f.each_line do |line|
|
52
52
|
count += 1
|
53
|
-
if
|
54
|
-
return line, count if line.similar(text) >=
|
53
|
+
if line =~ /<\S+>/
|
54
|
+
return line, count if line.similar(text) >= 76
|
55
55
|
elsif line =~ /#{text}/
|
56
56
|
return line, count
|
57
57
|
end
|