Sha256: c3238a7397c5c5ab4251b952e0ea0061c8f33f70837a89aa6106b5f3baf14bf5

Contents?: true

Size: 645 Bytes

Versions: 11

Compression:

Stored size: 645 Bytes

Contents

# encoding: utf-8

RSpec.describe TTY::Prompt::Question, 'ask multiline' do
  it 'reads multiple lines with :read option' do
    prompt = TTY::TestPrompt.new
    prompt.input << "First line\nSecond line\nThird line"
    prompt.input.rewind
    answer = prompt.ask("Provide description?", read: :multiline)
    expect(answer).to eq(['First line', 'Second line', 'Third line'])
  end

  it 'reads multiple lines with method' do
    prompt = TTY::TestPrompt.new
    prompt.input << "First\nSecond\nThird"
    prompt.input.rewind
    answer = prompt.multiline("Provide description?")
    expect(answer).to eq(['First', 'Second', 'Third'])
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tty-prompt-0.11.0 spec/unit/multiline_spec.rb
tty-prompt-0.10.1 spec/unit/multiline_spec.rb
tty-prompt-0.10.0 spec/unit/multiline_spec.rb
tty-prompt-0.9.0 spec/unit/multiline_spec.rb
tty-prompt-0.8.0 spec/unit/multiline_spec.rb
tty-prompt-0.7.1 spec/unit/multiline_spec.rb
tty-prompt-0.7.0 spec/unit/multiline_spec.rb
tty-prompt-0.6.0 spec/unit/multiline_spec.rb
tty-prompt-0.5.0 spec/unit/multiline_spec.rb
tty-prompt-0.4.0 spec/unit/multiline_spec.rb
tty-prompt-0.3.0 spec/unit/multiline_spec.rb