spec/kontena/cli/common_spec.rb in kontena-cli-1.4.3 vs spec/kontena/cli/common_spec.rb in kontena-cli-1.5.0.pre1

- old
+ new

@@ -135,11 +135,18 @@ describe '#confirm_command' do it 'returns true if input matches' do allow(subject).to receive(:ask).and_return('name-to-confirm') - expect(subject.confirm_command('name-to-confirm')).to be_truthy expect{subject.confirm_command('name-to-confirm')}.to_not raise_error + expect(subject.confirm_command('name-to-confirm')).to be_truthy + end + + it 'returns true if input matches and param is not a string' do + allow(subject).to receive(:ask).and_return('123') + + expect{subject.confirm_command(123)}.to_not raise_error + expect(subject.confirm_command(123)).to be_truthy end it 'raises error unless input matches' do expect(subject).to receive(:ask).and_return('wrong-name') expect(subject).to receive(:error).with(/did not match/)