Module: Mutineer::MinitestIntegration::OuterReporter::Client

Included in:
InTestDatabaseError, KillRecorder, StopAtFirstFailure
Defined in:
lib/mutineer/minitest_integration/outer_reporter.rb

Overview

The per-process state a client keeps. Forked workers inherit it, and the pid keeps them from acting on it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#armed_pid ⇒ Integer?

The pid of the armed process.

Returns:

  • (Integer, nil)


49
50
51
# File 'lib/mutineer/minitest_integration/outer_reporter.rb', line 49

def armed_pid
  @armed_pid
end

#armed_reporter ⇒ Minitest::CompositeReporter?

The outer reporter of the armed run.

Returns:

  • (Minitest::CompositeReporter, nil)


54
55
56
# File 'lib/mutineer/minitest_integration/outer_reporter.rb', line 54

def armed_reporter
  @armed_reporter
end

Instance Method Details

#armed_here? ⇒ Boolean

True when the client is armed in this process.

Returns:

  • (Boolean)


59
60
61
# File 'lib/mutineer/minitest_integration/outer_reporter.rb', line 59

def armed_here?
  armed_pid == Process.pid
end

#outer_reporter?(reporter) ⇒ Boolean

True when reporter is the outer reporter of the run armed in this process.

Parameters:

  • reporter (Minitest::CompositeReporter) —

    the recording reporter.

Returns:

  • (Boolean)


68
69
70
# File 'lib/mutineer/minitest_integration/outer_reporter.rb', line 68

def outer_reporter?(reporter)
  armed_here? && reporter.equal?(armed_reporter)
end