Sha256: 4013dbf5ee0ced5e42b504544d874b6a647eb25e5fd12a161dbb08671932ec58
Contents?: true
Size: 450 Bytes
Versions: 8
Compression:
Stored size: 450 Bytes
Contents
# encoding: utf-8 RSpec.describe TTY::Prompt::Question, 'convert path' do subject(:prompt) { TTY::TestPrompt.new } it "converts pathname" do path = double(:path) prompt.input << "/path/to/file" prompt.input.rewind allow(Pathname).to receive(:new).and_return(path) expect(Pathname).to receive(:new).with(/path\/to\/file/) answer = prompt.ask('File location?', convert: :path) expect(answer).to eql(path) end end
Version data entries
8 entries across 8 versions & 1 rubygems