Class: Spex::StartedCheck

Inherits:
ProcessCheck show all
Defined in:
lib/spex/checks/started_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



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

def after
  if active?
    assert current_pid, "Process '#{target}' was not started"
  else
    pid = current_pid
    assert_nil pid, "Process '#{target}' was started (pid #{pid})"
  end
end

#beforeObject



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

def before
  pid = current_pid
  assert !pid, "Process '#{target}' is already running (pid #{pid})"
end