Sha256: 7fb71def13040bac92b82cd818340210f8bf33b961c835352030f184a7eb0583
Contents?: true
Size: 573 Bytes
Versions: 5
Compression:
Stored size: 573 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 eql 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 eql name end end # default
Version data entries
5 entries across 5 versions & 1 rubygems