tracing-matchers 1.1.1 → 1.1.2

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: 800249d83ac708be40d92dc5f104babc29ee2204
4
- data.tar.gz: 1296e66232663e8a266496f8dd0c91fc5893ae65
3
+ metadata.gz: b6a880779848aa77afcc2f07ed6b5308d61c9d56
4
+ data.tar.gz: 48fbcc28168a2d447a4792c3b45dfbe6f778ceb7
5
5
  SHA512:
6
- metadata.gz: 1908c7e3093ac5638619fbd5445ddf62c5be6b693513a9d96206b51049f56cd93f72bed3a056a9540a9b5835d73cc1fc0799651d1fde6b3e9528667844893ef9
7
- data.tar.gz: 3c4a6badba3ba66e5d3ecc37277bc258e95345e6dbb5266570dd16f4c1edc027a60d15f338cc1c859d2f85e4462cd781e6a4e086eb7392e2553ebacb018a30ca
6
+ metadata.gz: 1839cb9e6bf129c05e22ceb409aafec59976b7f86f812aca27afd8798a292a39eb204e84d19d98451608d76399f36047db779cc1849c9982c05634f91eb2e416
7
+ data.tar.gz: bd5dc512cfbf105a681b98a3474ab38c8acd79c7d3178671c32755ac04674841360ca59a44d412959f86205361845bd471b8f5e4ad6cbc037aea16351962f894
data/README.md CHANGED
@@ -1,7 +1,13 @@
1
+ [![Build Status](https://travis-ci.org/iaintshine/ruby-tracing-matchers.svg?branch=master)](https://travis-ci.org/iaintshine/ruby-tracing-matchers)
2
+
1
3
  # Tracing::Matchers
2
4
 
3
5
  The gem exposes RSpec-compatible convenient one-liners, matchers, which you can use to test OpenTracing instrumentations, without having to use production OpenTracing Tracer e.g. Jaeger. It's expected that the gem will be used together with [test-tracer](https://github.com/iaintshine/ruby-test-tracer) - an OpenTracing compatible test Tracer implementation.
4
6
 
7
+ ## Documentation
8
+
9
+ For far more detailed documentation and usage examples check [matchers.rb](https://github.com/iaintshine/ruby-tracing-matchers/blob/master/lib/tracing/matchers.rb), [span_matchers.rb](https://github.com/iaintshine/ruby-tracing-matchers/blob/master/lib/tracing/matchers/span_matchers.rb), specs and [rubydoc.info](http://www.rubydoc.info/gems/tracing-matchers).
10
+
5
11
  ## Installation
6
12
 
7
13
  Add this line to your application's Gemfile:
@@ -27,30 +33,28 @@ expect(tracer).to have_traces(n)
27
33
  expect(tracer).to have_spans(n)
28
34
  .started
29
35
  .finished
30
- expect(tracer).to have_span(optional operation_name)
36
+ expect(tracer).to have_span(operation_name)
31
37
  .in_progress
32
- .started # alias for #in_progress
38
+ .started
33
39
  .finished
34
- .with_tags(optional hash of tags)
35
- .with_logs
36
- .with_log(optional fields)
37
- .with_baggage(optional baggage to match)
38
- .child_of(operation_name or span or context)
39
- .following_after(operation_name or span)
40
-
41
- expect(span).to have_tag
42
- expect(span).to have_tags
43
- expect(span).to have_log
44
- expect(span).to have_logs
45
- expect(span).to have_baggage
46
- expect(span).to have_baggage_item
40
+ .with_tags(*tags)
41
+ .with_logs(**fields)
42
+ .with_log(**fields)
43
+ .with_baggage(*baggage)
44
+ .child_of(operation_name|span|span_context)
45
+ .following_after(operation_name|span)
46
+
47
+ expect(span).to have_tag(*tags)
48
+ expect(span).to have_tags(*tags)
49
+ expect(span).to have_log(**fields)
50
+ expect(span).to have_logs(**fields)
51
+ expect(span).to have_baggage(*baggage)
52
+ expect(span).to have_baggage_item(*baggage)
47
53
  expect(span).to have_parent
48
- expect(span).to be_child_of
49
- expect(span).to follow_after(String|Span)
54
+ expect(span).to be_child_of(opration_name|span|span_context)
55
+ expect(span).to follow_after(operation_name|span)
50
56
  ```
51
57
 
52
- Detailed documentation and usage examples can be found in [matchers.rb](https://github.com/iaintshine/ruby-tracing-matchers/blob/master/lib/tracing/matchers.rb) file.
53
-
54
58
  ## Usage
55
59
 
56
60
  High-level test examples.
@@ -6,7 +6,7 @@ require "tracing/matchers/have_span"
6
6
 
7
7
  module Tracing
8
8
  module Matchers
9
- # The `have_traces` matcher tests that the tracer traced any or a specific
9
+ # The have_traces matcher tests that the tracer traced any or a specific
10
10
  # number of **traces**.
11
11
  #
12
12
  # @example
@@ -36,7 +36,7 @@ module Tracing
36
36
  Tracing::Matchers::HaveTraces.new(n)
37
37
  end
38
38
 
39
- # The `have_spans` matcher tests that the tracer traced any or a specific
39
+ # The have_spans matcher tests that the tracer traced any or a specific
40
40
  # number of **spans**.
41
41
  #
42
42
  # @example
@@ -66,7 +66,7 @@ module Tracing
66
66
  Tracing::Matchers::HaveSpans.new(n)
67
67
  end
68
68
 
69
- # The `have_span` matcher tests that the tracer traced a span matching a criteria.
69
+ # The have_span matcher tests that the tracer traced a span matching a criteria.
70
70
  #
71
71
  # @example
72
72
  #
@@ -6,7 +6,7 @@ require "tracing/matchers/span/follow_after"
6
6
 
7
7
  module Tracing
8
8
  module Matchers
9
- # The `have_tag` matcher tests that the span includes tags.
9
+ # The have_tag matcher tests that the span includes tags.
10
10
  # @example
11
11
  #
12
12
  # # Passes if span have any tag
@@ -22,7 +22,7 @@ module Tracing
22
22
  end
23
23
  alias :have_tags :have_tag
24
24
 
25
- # The `have_log` matcher tests that the span includes a tag.
25
+ # The have_log matcher tests that the span includes a tag.
26
26
  # @example
27
27
  #
28
28
  # # Passes if span have any log
@@ -37,7 +37,7 @@ module Tracing
37
37
  end
38
38
  alias :have_logs :have_log
39
39
 
40
- # The `have_baggage` matcher tests that the span/span context includes baggage.
40
+ # The have_baggage matcher tests that the span/span context includes baggage.
41
41
  # @example
42
42
  #
43
43
  # # Passes if span have any baggage item
@@ -53,7 +53,7 @@ module Tracing
53
53
  end
54
54
  alias :have_baggage_item :have_baggage
55
55
 
56
- # The `be_child_of` matcher tests that the span/span context is a child of some other span/span context.
56
+ # The be_child_of matcher tests that the span/span context is a child of some other span/span context.
57
57
  # @example
58
58
  #
59
59
  # # Passes if span is a child of any span
@@ -64,13 +64,14 @@ module Tracing
64
64
  # expect(span).to be_child_of(parent_span)
65
65
  # expect(span).to be_child_of(parent_span_context)
66
66
  #
67
+ # @param [String, Span, SpanContext] parent
67
68
  # @return [HaveBaggage]
68
69
  def be_child_of(parent = :any)
69
70
  Tracing::Matchers::Span::BeChildOf.new(parent)
70
71
  end
71
72
  alias :have_parent :be_child_of
72
73
 
73
- # The `follow_after` matcher tests that the span follows after some other span.
74
+ # The follow_after matcher tests that the span follows after some other span.
74
75
  # @example
75
76
  #
76
77
  # # Passes if span follows after spcific span
@@ -1,5 +1,5 @@
1
1
  module Tracing
2
2
  module Matchers
3
- VERSION = "1.1.1"
3
+ VERSION = "1.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracing-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - iaintshine