Sha256: 585c0a3e704990695cdcceda82ec4b3bd4338d0930450bd41e781e61a4a04516

Contents?: true

Size: 370 Bytes

Versions: 6

Compression:

Stored size: 370 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe TTY::Shell::Question, '#read_char' do
  let(:input)  { StringIO.new }
  let(:output) { StringIO.new }
  let(:shell) { TTY::Shell.new(input, output) }

  it 'reads single character' do
    input << "abcde"
    input.rewind
    q = shell.ask("What is your favourite letter?")
    expect(q.read_char).to eql "a"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tty-0.2.1 spec/tty/shell/response/read_char_spec.rb
tty-0.2.0 spec/tty/shell/response/read_char_spec.rb
tty-0.1.3 spec/tty/shell/response/read_char_spec.rb
tty-0.1.2 spec/tty/shell/response/read_char_spec.rb
tty-0.1.1 spec/tty/shell/response/read_char_spec.rb
tty-0.1.0 spec/tty/shell/response/read_char_spec.rb