Sha256: 4dbe9168970d3d8a7317809b4b8a323d3a091d10d2a7459b9764fc093a274a0e
Contents?: true
Size: 565 Bytes
Versions: 6
Compression:
Stored size: 565 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe TTY::Shell::Question, '#default' do let(:input) { StringIO.new } let(:output) { StringIO.new } let(:shell) { TTY::Shell.new(input, output) } it 'uses default value' do name = 'Anonymous' q = shell.ask("What is your name?").default(name) answer = q.read expect(answer).to eq(name) end it 'uses default value in block' do name = 'Anonymous' q = shell.ask "What is your name?" do default name end answer = q.read expect(answer).to eq(name) end end # default
Version data entries
6 entries across 6 versions & 1 rubygems