Sha256: 19a08dc438a12392cffc659b262a42756226878540b2e12109c5bbfce9603c95
Contents?: true
Size: 726 Bytes
Versions: 25
Compression:
Stored size: 726 Bytes
Contents
require 'spec_helper' require 'ostruct' describe KumoKeisei::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
25 entries across 25 versions & 1 rubygems