Sha256: 4b9bd92480caf134686bf1ba9a3c82658219407b755c214315fc1e7df77b35e0

Contents?: true

Size: 406 Bytes

Versions: 2

Compression:

Stored size: 406 Bytes

Contents

# encoding: utf-8

require 'tty/prompt'

module TTY
  # Used for initializing test cases
  class TestPrompt < Prompt
    def initialize(options = {})
      @input  = StringIO.new
      @output = StringIO.new
      options.merge!({
        input: @input,
        output: @output,
        enable_color: options.fetch(:enable_color) { true }
      })
      super(options)
    end
  end # TestPrompt
end # TTY

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tty-prompt-0.10.1 lib/tty/prompt/test.rb
tty-prompt-0.10.0 lib/tty/prompt/test.rb