Sha256: 94cab989549ba3e3bef114d1c89cae8cb7cf5648612f98f9f79ba9a2c41b052a

Contents?: true

Size: 311 Bytes

Versions: 15

Compression:

Stored size: 311 Bytes

Contents

# encoding: utf-8

RSpec.describe TTY::Prompt::Question, 'convert char' do
  it 'reads single character' do
    prompt = TTY::TestPrompt.new
    prompt.input << "abcde"
    prompt.input.rewind
    response = prompt.ask("What is your favourite letter?", convert: :char)
    expect(response).to eq('a')
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
tty-prompt-0.17.2 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.17.1 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.17.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.12.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.11.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.10.1 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.10.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.9.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.8.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.7.1 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.7.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.6.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.5.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.4.0 spec/unit/converters/convert_char_spec.rb
tty-prompt-0.3.0 spec/unit/converters/convert_char_spec.rb