Class: Spex::StoppedCheck

Inherits:
ProcessCheck show all
Defined in:
lib/spex/checks/stopped_check.rb

Instance Attribute Summary

Attributes inherited from Check

#options, #target

Instance Method Summary collapse

Methods inherited from ProcessCheck

#current_pid, #pattern, #ps_executable

Methods inherited from Check

[], #active?, as, each, example, examples, #initialize, option, options, #prepare, registry, #to_s, #validate!

Constructor Details

This class inherits a constructor from Spex::Check

Instance Method Details

#afterObject



11
12
13
14
15
16
17
18
# File 'lib/spex/checks/stopped_check.rb', line 11

def after
  pid = current_pid
  if active?
    assert_nil pid, "Process '#{target}' is still running (pid #{pid})"
  else
    assert_not_nil pid, "Process '#{target}' was stopped"
  end
end

#beforeObject



7
8
9
# File 'lib/spex/checks/stopped_check.rb', line 7

def before
  assert current_pid, "Process '#{target}' is not running (will not be stopped)"
end