Class: Procrastinator::Test::MockThread
- Inherits:
-
Object
- Object
- Procrastinator::Test::MockThread
- Defined in:
- lib/procrastinator/test/mocks.rb
Overview
Testing mock Thread class
Instance Attribute Summary collapse
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #alive? ⇒ Boolean
-
#initialize(name: nil, status: nil) ⇒ MockThread
constructor
A new instance of MockThread.
- #join(_timeout) ⇒ Object
- #kill ⇒ Object
- #thread_variable_get(var_name) ⇒ Object
Constructor Details
#initialize(name: nil, status: nil) ⇒ MockThread
Returns a new instance of MockThread.
56 57 58 59 |
# File 'lib/procrastinator/test/mocks.rb', line 56 def initialize(name: nil, status: nil) @name = name @status = status end |
Instance Attribute Details
#status ⇒ Object (readonly)
Returns the value of attribute status.
54 55 56 |
# File 'lib/procrastinator/test/mocks.rb', line 54 def status @status end |
Instance Method Details
#alive? ⇒ Boolean
67 68 69 |
# File 'lib/procrastinator/test/mocks.rb', line 67 def alive? true end |
#join(_timeout) ⇒ Object
61 62 |
# File 'lib/procrastinator/test/mocks.rb', line 61 def join(_timeout) end |
#kill ⇒ Object
64 65 |
# File 'lib/procrastinator/test/mocks.rb', line 64 def kill end |
#thread_variable_get(var_name) ⇒ Object
71 72 73 74 75 76 77 78 |
# File 'lib/procrastinator/test/mocks.rb', line 71 def thread_variable_get(var_name) case var_name when :name @name else raise 'test error: undefined thread var' end end |