Cuprum::Cli

A command-line utility powered by Cuprum that provides tools and utilities for defining command-line tools.

Class: Cuprum::Cli::Dependencies::StandardIo::Mock

Parent Namespace
Cuprum::Cli::Dependencies::StandardIo
Inherited Classes
Cuprum::Cli::Dependencies::StandardIo > Object
Defined In
lib/cuprum/cli/dependencies/standard_io/mock.rb

Table Of Contents

Overview

Mock implementation of StandardIo for testing purposes.

Back To Top

Class Methods

.append_for_read(*messages, io:) => IO

Utility method for appending readable data to a StringIO stream.

Parameters

Returns

Back To Top

Constructor

#initialize(error_stream: StringIO.new, input_stream: StringIO.new, output_stream: StringIO.new) => Mock

Parameters

Returns

Back To Top

Instance Attributes

#combined_stream => IO (readonly)

Returns

Back To Top

Instance Methods

#color(text, color) => String

Inherited From
Cuprum::Cli::Dependencies::StandardIo

Wraps the text in an ANSI color escape code.

Parameters

Returns

Raises

#error_stream => IO

Returns

#input_stream => IO

Returns

#output_stream => IO

Returns

#read_input => String

Requests a newline-terminated string from the input stream.

Returns

#write_error(message = nil, newline: true) => nil

Writes the given message to the error stream.

If no error message is given, prints a newline only.

Parameters

Returns

#write_output(message = nil, newline: true) => nil

Writes the given message to the output stream.

If no message is given, prints a newline only.

Parameters

Returns

Back To Top


Back to Documentation | Reference | Cuprum | Cuprum::Cli | Cuprum::Cli::Dependencies | Cuprum::Cli::Dependencies::StandardIo