Sha256: 2e78d180053f5c06f9bf8851a696574cbe88fd2fa254147741694c773bb55037
Contents?: true
Size: 731 Bytes
Versions: 12
Compression:
Stored size: 731 Bytes
Contents
require 'spec_helper' require 'ostruct' describe KumoDockerCloud::ConsoleJockey do describe "#get_confirmation" do let(:timeout) { 0.5 } subject { described_class } context 'no timeout' do it 'returns true if user enters yes' do allow(STDIN).to receive(:gets) { 'yes'} expect(subject.get_confirmation(timeout)).to be true end it 'returns false if user enters anything other than yes' do allow(STDIN).to receive(:gets) { 'aoisdjofa'} expect(subject.get_confirmation).to be false end end context 'timeout' do it 'returns false if there is a timeout' do expect(subject.get_confirmation(timeout)).to be false end end end end
Version data entries
12 entries across 12 versions & 1 rubygems