Sha256: 92372174f0f1fe19890fbdd95d81fa5d45b642f2d5d75ef5331b9fa5d5d5aee9
Contents?: true
Size: 425 Bytes
Versions: 15
Compression:
Stored size: 425 Bytes
Contents
# encoding: utf-8 RSpec.describe TTY::Prompt::Question, 'convert custom' do subject(:prompt) { TTY::TestPrompt.new } it 'converts response with custom conversion' do prompt.input << "one,two,three\n" prompt.input.rewind conversion = proc { |input| input.split(/,\s*/) } answer = prompt.ask('Ingredients? (comma sep list)', convert: conversion) expect(answer).to eq(['one','two','three']) end end
Version data entries
15 entries across 15 versions & 1 rubygems