Class: Tracing::Matchers::Span::FollowAfter

Inherits:
Object
  • Object
show all
Includes:
Test::TypeCheck
Defined in:
lib/tracing/matchers/span/follow_after.rb

Instance Method Summary collapse

Constructor Details

#initialize(previous) ⇒ FollowAfter

Returns a new instance of FollowAfter.



8
9
10
11
# File 'lib/tracing/matchers/span/follow_after.rb', line 8

def initialize(previous)
  NotNull! previous
  @expected = previous
end

Instance Method Details

#descriptionString

Returns:

  • (String)


23
24
25
# File 'lib/tracing/matchers/span/follow_after.rb', line 23

def description
  "follow after #{expected_message}"
end

#failure_messageString Also known as: failure_message_for_should

Returns:

  • (String)


28
29
30
# File 'lib/tracing/matchers/span/follow_after.rb', line 28

def failure_message
  "expected #{subject_message} to follow after #{expected_message}"
end

#failure_message_when_negatedString Also known as: failure_message_for_should_not

Returns:

  • (String)


34
35
36
# File 'lib/tracing/matchers/span/follow_after.rb', line 34

def failure_message_when_negated
  "did not expected #{subject_message} to follow after #{expected_message}"
end

#matches?(span) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
20
# File 'lib/tracing/matchers/span/follow_after.rb', line 14

def matches?(span)
  @tracer = span.tracer
  @subject = span

  return false unless expected_index && subject_index
  expected_index < subject_index
end