Class: Spex::RestartedCheck
- Inherits:
-
ProcessCheck
- Object
- Check
- ProcessCheck
- Spex::RestartedCheck
- Defined in:
- lib/spex/checks/restarted_check.rb
Instance Attribute Summary
Attributes inherited from Check
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
#after ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/spex/checks/restarted_check.rb', line 12 def after after_pid = current_pid assert after_pid, "Process '#{target}' is not running" if active? assert_not_equal @before_pid, after_pid, "Process '#{target}' pid was not changed (still #{@before_pid})" else assert_equal @before_pid, after_pid, "Process '#{target}' pid was changed (was #{@before_pid}, now #{after_pid})" end end |
#before ⇒ Object
7 8 9 10 |
# File 'lib/spex/checks/restarted_check.rb', line 7 def before @before_pid = current_pid assert @before_pid, "Process '#{target}' is not running" end |