tracing-matchers 1.2.1 → 1.3.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e36744b462688ff29eec076751f1b195b5803d9b
|
4
|
+
data.tar.gz: 20c88ccb3e32bc48f522772ff15ca81bc6ff0680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7e9dd2a5e20bccbda470c4b17fdd43f33fb87717448d5dde27699d2c200a4040ee4ee83f8f579f0bcaba7018ebd15b924febdd2234de7f998ad0f42eba92bd5
|
7
|
+
data.tar.gz: 334a86f84866721b5cec15be43507f3f04f9687dfe33037f3ca8c6fa08d1374928ff48d3f8d5a47b2371164c5e01e25ee7e442f1ecfea25d63656fa981ddc876
|
@@ -16,7 +16,7 @@ module Tracing
|
|
16
16
|
if any?
|
17
17
|
@actual.any?
|
18
18
|
else
|
19
|
-
@expected.all? { |k, v| @actual.key?(k) && v
|
19
|
+
@expected.all? { |k, v| @actual.key?(k) && values_match?(v, @actual[k]) }
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -44,6 +44,10 @@ module Tracing
|
|
44
44
|
def any?
|
45
45
|
@expected.empty?
|
46
46
|
end
|
47
|
+
|
48
|
+
def values_match?(expected, actual)
|
49
|
+
expected.is_a?(Regexp) ? expected.match(actual) : expected == actual
|
50
|
+
end
|
47
51
|
end
|
48
52
|
end
|
49
53
|
end
|
@@ -16,7 +16,7 @@ module Tracing
|
|
16
16
|
@actual.any?
|
17
17
|
else
|
18
18
|
@actual.any? do |log|
|
19
|
-
@expected.all? { |k, v| log.key?(k) && v
|
19
|
+
@expected.all? { |k, v| log.key?(k) && values_match?(v, log[k]) }
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -45,6 +45,10 @@ module Tracing
|
|
45
45
|
def any?
|
46
46
|
@expected.empty?
|
47
47
|
end
|
48
|
+
|
49
|
+
def values_match?(expected, actual)
|
50
|
+
expected.is_a?(Regexp) ? expected.match(actual) : expected == actual
|
51
|
+
end
|
48
52
|
end
|
49
53
|
end
|
50
54
|
end
|
@@ -16,7 +16,7 @@ module Tracing
|
|
16
16
|
if any?
|
17
17
|
@actual.any?
|
18
18
|
else
|
19
|
-
@expected.all? { |k, v| @actual.key?(k) && v
|
19
|
+
@expected.all? { |k, v| @actual.key?(k) && values_match?(v, @actual[k]) }
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -44,6 +44,10 @@ module Tracing
|
|
44
44
|
def any?
|
45
45
|
@expected.empty?
|
46
46
|
end
|
47
|
+
|
48
|
+
def values_match?(expected, actual)
|
49
|
+
expected.is_a?(Regexp) ? expected.match(actual) : expected == actual
|
50
|
+
end
|
47
51
|
end
|
48
52
|
end
|
49
53
|
end
|
@@ -15,6 +15,7 @@ module Tracing
|
|
15
15
|
# # Passes if span includes a tag with "tag" key, and "value" value
|
16
16
|
# expect(span).to have_tag("key", "value")
|
17
17
|
# expect(span).to have_tag("key" => "value")
|
18
|
+
# expect(span).to have_tag("key", /value/)
|
18
19
|
#
|
19
20
|
# @return [HaveTag]
|
20
21
|
def have_tag(*args)
|
@@ -30,6 +31,7 @@ module Tracing
|
|
30
31
|
#
|
31
32
|
# # Passes if span includes a log entry with event: "error"
|
32
33
|
# expect(span).to have_log(event: "error")
|
34
|
+
# expect(span).to have_log(message: /description/)
|
33
35
|
#
|
34
36
|
# @return [HaveTag]
|
35
37
|
def have_log(**fields)
|
@@ -46,6 +48,7 @@ module Tracing
|
|
46
48
|
# # Passes if span includes a baggage item with "tag" key, and "value" value
|
47
49
|
# expect(span).to have_baggage("key", "value")
|
48
50
|
# expect(span).to have_baggage("key" => "value")
|
51
|
+
# expect(span).to have_baggage("key", /value/)
|
49
52
|
#
|
50
53
|
# @return [HaveBaggage]
|
51
54
|
def have_baggage(*args)
|