Sha256: 07ac938b9a248aaee30bf30d0469f8efcac67c3b60b8e3c14eb43141c5b2f6dc
Contents?: true
Size: 585 Bytes
Versions: 5
Compression:
Stored size: 585 Bytes
Contents
require 'spec_helper' describe Virtus::Coercion::String, '.to_boolean' do subject { object.to_boolean(string) } let(:object) { described_class } %w[ 1 t true T TRUE ].each do |value| context "with #{value.inspect}" do let(:string) { value } it { should be(true) } end end %w[ 0 f false F FALSE ].each do |value| context "with #{value.inspect}" do let(:string) { value } it { should be(false) } end end context 'with an invalid boolean string' do let(:string) { 'non-boolean' } it { should equal(string) } end end
Version data entries
5 entries across 5 versions & 1 rubygems