struct

Athena::Console::Spec::ApplicationTester

Inherits Athena::Console::Spec::Tester / Struct / Value / Object

Functionally similar to ACON::Spec::CommandTester, but used for testing entire ACON::Applications.

Can be useful if your project extends the base application in order to customize it in some way.

NOTE: Be sure to set ACON::Application#auto_exit= to false, when testing an entire application.

Constructors

new(application : ACON::Application)
Source

Instance methods

application

Returns the ACON::Application instance being tested.

Source
input

Returns the ACON::Input::Interface being used by the tester.

Source
input?

Returns the ACON::Input::Interface being used by the tester.

Source
run(input : Hash(String, _) = Hash(String, String).new, *, decorated : Bool | Nil = nil, interactive : Bool | Nil = nil, capture_stderr_separately : Bool = false, verbosity : ACON::Output::Verbosity | Nil = nil) : ACON::Command::Status

Runs the application, with the provided input being used as the input of ACON::Application#run.

Custom values for decorated, interactive, and verbosity can also be provided and will be forwarded to their respective types. capture_stderr_separately makes it so output to STDERR is captured separately, in case you wanted to test error output. Otherwise both error and normal output are captured via ACON::Spec::Tester#display.

Source
run(decorated : Bool = false, interactive : Bool | Nil = nil, capture_stderr_separately : Bool = false, verbosity : ACON::Output::Verbosity | Nil = nil, **input : _)

Runs the application, with the provided input being used as the input of ACON::Application#run.

Custom values for decorated, interactive, and verbosity can also be provided and will be forwarded to their respective types. capture_stderr_separately makes it so output to STDERR is captured separately, in case you wanted to test error output. Otherwise both error and normal output are captured via ACON::Spec::Tester#display.

Source
status

Returns the ACON::Command::Status of the command execution, or nil if it has not yet been executed.

Source