Class: Caliph::MockCommandResult
- Inherits:
-
CommandRunResult
- Object
- CommandRunResult
- Caliph::MockCommandResult
- Defined in:
- lib/caliph/testing/mock-command-line.rb
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
(also: #exit_status)
readonly
Returns the value of attribute exit_code.
-
#streams ⇒ Object
readonly
Returns the value of attribute streams.
Attributes inherited from CommandRunResult
#command, #consume_timeout, #pid, #process_status
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(code, streams) ⇒ MockCommandResult
constructor
A new instance of MockCommandResult.
Methods inherited from CommandRunResult
#consume_buffers, #format_streams, #kill, #must_succeed!, #running?, #stderr, #stdout, #succeeded?, #wait
Constructor Details
#initialize(code, streams) ⇒ MockCommandResult
Returns a new instance of MockCommandResult.
17 18 19 20 |
# File 'lib/caliph/testing/mock-command-line.rb', line 17 def initialize(code, streams) @streams = streams @exit_code = code end |
Instance Attribute Details
#exit_code ⇒ Object (readonly) Also known as: exit_status
Returns the value of attribute exit_code.
22 23 24 |
# File 'lib/caliph/testing/mock-command-line.rb', line 22 def exit_code @exit_code end |
#streams ⇒ Object (readonly)
Returns the value of attribute streams.
22 23 24 |
# File 'lib/caliph/testing/mock-command-line.rb', line 22 def streams @streams end |
Class Method Details
.create(*args) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/caliph/testing/mock-command-line.rb', line 5 def self.create(*args) if args.length == 1 args = [args[0], {1 => ""}] end if String == args[1] args[1] = {1 => args[1]} end return self.new(*args) end |