cucumber_junit_to_json 0.1.8 → 0.1.9

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: 18d4d257e6c51b31baf48db05f674059434061e0
4
- data.tar.gz: d7c7aae775d4c25e8f5e52a233b3e01f4e7e62dd
3
+ metadata.gz: bb8c3bfb9aa4a9374187d12e85a853fbb8b1fd52
4
+ data.tar.gz: e2734b498cc248ed61d4be5658acd4fbe451ba21
5
5
  SHA512:
6
- metadata.gz: 78e8d0b06be094ad609f8088da431ae5d2bf4ec9b04c921fea39640d7b8f23c37f1dc7464c7c8819613e8f4d60a87d70dc45a4d6808b3c04c1cc5b7fa15f8a15
7
- data.tar.gz: 5f52fab3e29955a5ded264ebe0f8c9bf0a7df6b7beffac69658eb6cf66be4e1093bf695b04ba5ea68da835dea33e04adf1791a74bf05a887554320c3ee06c2e4
6
+ metadata.gz: d50d186c52c9d05276130196b8613503c49b103e6a04e2da92fb2ab1001e3ee1ddf0e9701d6bdb15317f3d5614d5dc809bc075475d5b46aa269f45ee82be014a
7
+ data.tar.gz: 0cbb5884e2679e19f69fbc89482449a74951bfcb0a25c3e83852270b25ca60c0d2dc9bd0de788af870bc2946ad1da763ae494ba20d59ee4a0ecc822e4e0a4e97
@@ -92,8 +92,10 @@ module CucumberJunitToJson
92
92
  end
93
93
  end
94
94
  # Removing scenario outline added blob gives you the actual scenario name
95
+ use_similar_matcher = false
96
+ use_similar_matcher = true if testcase['name'].include?('-- @')
95
97
  scenario.name = testcase['name'].split('-- @').first.strip
96
- scenario.tags, scenario.line = @feature_parser.tags_and_line_number_matching(feature_uri, scenario.name)
98
+ scenario.tags, scenario.line = @feature_parser.tags_and_line_number_matching(feature_uri, scenario.name, use_similar_matcher)
97
99
  scenario_line_text = @feature_parser.text_and_line_number_matching(feature_uri, scenario.name).first
98
100
  scenario.keyword = scenario_line_text.split(':').first.strip
99
101
  scenario.type = 'scenario'
@@ -85,7 +85,7 @@ module CucumberJunitToJson
85
85
  if line =~ /<\S+>/
86
86
  # A match percentage greater than 80 is an indication
87
87
  # of a good match for scenarios
88
- found_scenario = true if line.similar(scenario) >= 76
88
+ found_scenario = true if line.similar(scenario) >= 73
89
89
  elsif line =~ /#{scenario}/
90
90
  found_scenario = true
91
91
  end
@@ -93,7 +93,7 @@ module CucumberJunitToJson
93
93
  # Check if we got a match anchor in line.
94
94
  # If there is, use a similar matcher
95
95
  if line =~ /<\S+>/
96
- # A match percentage greater than 76 is an indication
96
+ # A match percentage greater than 67 is an indication
97
97
  # of a good match for steps
98
98
  return line, count if line.similar(step) >= 67
99
99
  elsif line =~ /#{step}/
@@ -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, similar = false)
21
+ tags, line = text_and_line_number_before_match(file, text, similar)
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, similar = false)
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 line =~ /<\S+>/
38
- return prev_line_text, count if line.similar(text) >= 76
37
+ if similar || line =~ /<\S+>/
38
+ return prev_line_text, count if line.similar(text) >= 73
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, similar = false)
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 line =~ /<\S+>/
54
- return line, count if line.similar(text) >= 76
53
+ if similar || line =~ /<\S+>/
54
+ return line, count if line.similar(text) >= 73
55
55
  elsif line =~ /#{text}/
56
56
  return line, count
57
57
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Cucumber Junit to Json version module
4
4
  module CucumberJunitToJson
5
- VERSION = '0.1.8'
5
+ VERSION = '0.1.9'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cucumber_junit_to_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Voke Ransom Anighoro
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-06 00:00:00.000000000 Z
11
+ date: 2018-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler