allure-ruby-commons 2.14.4 → 2.14.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/allure_ruby_commons/result_utils.rb +20 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35b9aec57c1f8d285f55f1463266c70daec925400f3880ddf6cacd2b237eb120
|
4
|
+
data.tar.gz: 5fe9f0fcef4d39ed38cec526856712948f77c72529e13fe342e507ffcdf2ad2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0d038d11530965ea7cc37135496fe4e0071a8fb8f975d9bad3be724e5c04b9b88ae6027a2cd6a2ed227e499742e2ec35cb63e87062bbcec0696b6def3609ed8
|
7
|
+
data.tar.gz: 7a9dca1b51f2d0948aec73ef6749a289a8ef6be9831dcca3ba80292defedb42c58ad47e2cfce8b810bf2845ea0e02963bb5b9135bb29b422e9b854b9385b5dab
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "socket"
|
4
|
+
require "uri"
|
4
5
|
|
5
6
|
module Allure
|
6
7
|
# Variouse helper methods
|
@@ -133,16 +134,18 @@ module Allure
|
|
133
134
|
# @param [String] value
|
134
135
|
# @param [String] link_pattern
|
135
136
|
# @return [Allure::Link]
|
136
|
-
def tms_link(value, link_pattern)
|
137
|
-
|
137
|
+
def tms_link(name, value, link_pattern)
|
138
|
+
link_name = url?(value) ? name : value
|
139
|
+
Link.new(TMS_LINK_TYPE, link_name, url(value, link_pattern))
|
138
140
|
end
|
139
141
|
|
140
142
|
# Issue link
|
141
143
|
# @param [String] value
|
142
144
|
# @param [String] link_pattern
|
143
145
|
# @return [Allure::Link]
|
144
|
-
def issue_link(value, link_pattern)
|
145
|
-
|
146
|
+
def issue_link(name, value, link_pattern)
|
147
|
+
link_name = url?(value) ? name : value
|
148
|
+
Link.new(ISSUE_LINK_TYPE, link_name, url(value, link_pattern))
|
146
149
|
end
|
147
150
|
|
148
151
|
# Get status based on exception type
|
@@ -171,6 +174,19 @@ module Allure
|
|
171
174
|
|
172
175
|
private
|
173
176
|
|
177
|
+
# Check if value is full url
|
178
|
+
#
|
179
|
+
# @param [String] value
|
180
|
+
# @return [Boolean]
|
181
|
+
def url?(value)
|
182
|
+
URI.parse(value.to_s).scheme
|
183
|
+
end
|
184
|
+
|
185
|
+
# Construct url from pattern
|
186
|
+
#
|
187
|
+
# @param [String] value
|
188
|
+
# @param [String] link_pattern
|
189
|
+
# @return [String]
|
174
190
|
def url(value, link_pattern)
|
175
191
|
link_pattern.sub("{}", value)
|
176
192
|
end
|