Sha256: 985f895e5b3c0ec3b6ffde388500aba6edfb276e0e782cbe8a8d4937f55883f9
Contents?: true
Size: 535 Bytes
Versions: 6
Compression:
Stored size: 535 Bytes
Contents
# encoding: utf-8 require 'spec_helper' describe TTY::Shell::Question::Validation, '#coerce' do let(:validation) { "^[^\.]+\.[^\.]+" } let(:instance) { described_class.new } subject { instance.coerce validation } it { should be_kind_of Regexp } context 'when proc' do let(:validation) { lambda { "^[^\.]+\.[^\.]+" } } it { is_expected.to be_kind_of Proc } end context 'when unkown type' do let(:validation) { Object.new } it { expect { subject }.to raise_error(TTY::ValidationCoercion) } end end
Version data entries
6 entries across 6 versions & 1 rubygems