Class: Caliph::MockCommandResult
- Inherits:
-
CommandRunResult
- Object
- CommandRunResult
- Caliph::MockCommandResult
- Defined in:
- lib/caliph/testing/mock-command-line.rb
Instance Attribute Summary (collapse)
-
- (Object) exit_code
(also: #exit_status)
readonly
Returns the value of attribute exit_code.
-
- (Object) streams
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)
-
- (MockCommandResult) initialize(code, streams)
constructor
A new instance of MockCommandResult.
Methods inherited from CommandRunResult
#consume_buffers, #format_streams, #kill, #must_succeed!, #running?, #stderr, #stdout, #succeeded?, #wait
Constructor Details
- (MockCommandResult) initialize(code, streams)
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
- (Object) exit_code (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 |
- (Object) streams (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
+ (Object) create(*args)
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 |