Class: TTY::TestPrompt
Overview
Used for initializing test cases
Constant Summary
Constants inherited from Prompt
Prompt::ArgumentRequired, Prompt::ArgumentValidation, Prompt::ConfigurationError, Prompt::ConversionError, Prompt::InvalidArgument, Prompt::VERSION, Prompt::ValidationCoercion
Instance Attribute Summary
Attributes inherited from Prompt
#active_color, #cursor, #enabled_color, #error_color, #help_color, #input, #output, #prefix, #reader
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ TestPrompt
constructor
A new instance of TestPrompt.
Methods inherited from Prompt
#ask, #collect, #enum_select, #error, #expand, #inspect, #invoke_question, #invoke_select, #keypress, #mask, messages, #multi_select, #multiline, #no?, #ok, #say, #select, #slider, #stderr, #stdin, #stdout, #suggest, #tty?, #warn, #yes?
Constructor Details
#initialize(options = {}) ⇒ TestPrompt
Returns a new instance of TestPrompt.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/tty/test_prompt.rb', line 8 def initialize( = {}) @input = StringIO.new @output = StringIO.new .merge!({ input: @input, output: @output, env: { "TTY_TEST" => true }, enable_color: .fetch(:enable_color) { true } }) super() end |