Sha256: 90e6aae9c1286f5742800ba91fe99528d444e8a25b4a9cd80d437f9fc9478f3f

Contents?: true

Size: 1.16 KB

Versions: 1

Compression:

Stored size: 1.16 KB

Contents

# encoding: utf-8

require 'spec_helper'
require 'cliprompt'

describe Cliprompt do

  describe '.ask' do
    Given(:input) { StringIO.new }
    Given(:output) { StringIO.new }
    Given { subject.setio(input, output) }

    # context 'when it is free form,' do
    #   When(:question) { 'wazza?' }
    #   context 'without default,' do
    #     When(:args) { }
    #     When { subject.input.stub(:gets).and_return("\n") }
    #     When { subject.ask(question, args) }
    #     Then { expect(output).to receive(:print).with("#{question}  ") }
    #     context 'when enter key is used,' do
    #       When(:answer) { subject.ask(question) }
    #       When { input.gets("\n") }
    #       Then { expect(output).to receive(:puts).with(Cliprompt::MSG_MANDATORY_TEXT)}
    #     end
    #   end
    #   it 'is displayed ay the end of the question' do
    #   end
    # end
    context 'when there is no preset choices,' do
      it 'only displays the question' do
      end
    end
    context 'when enter is typed,' do
      it 'returns the default value' do
      end
    end
    context 'when a value is provided' do
      it 'returns the value' do
      end
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cliprompt-0.0.1 spec/lib/cliprompt_spec.rb