Sha256: 2e19e055d20e588714f567915ac29e7b4114caba9e544ecd700d4d9221edb27a
Contents?: true
Size: 1018 Bytes
Versions: 2
Compression:
Stored size: 1018 Bytes
Contents
describe WannabeBool::String do describe '#to_b' do [ '1', '1 ', ' 1', ' 1 ', 't', 't ', ' t', ' t ', 'T', 'T ', ' T', ' T ', 'true', 'true ', ' true', ' true ', 'TRUE', 'TRUE ', ' TRUE', ' TRUE ', 'on', 'on ', ' on', ' on ', 'ON', 'ON ', ' ON ', ' ON ', 'y', 'y ', ' y', ' y ', 'Y', 'Y ', ' Y', ' Y ', 'yes', 'yes ', ' yes', ' yes ', 'YES', 'YES ', ' YES', ' YES ' ].each do |value| context "when string is '#{value}'" do subject { value } it { expect(subject.to_b).to be true } end end [ '', '0', '2', '2 ', ' 2', ' 2 ', '-1', '-1 ', ' -1', ' -1 ', '-2', '-2 ', ' -2', ' -2 ', 'f', 'F', 'false', 'FALSE', 'off', 'OFF', 'n', 'N', 'no', 'NO', 'not', 'NOT', 'wherever', 'Prodis' ].each do |value| context "when string is '#{value}'" do subject { value } it { expect(subject.to_b).to be false } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
wannabe_bool-0.5.0 | spec/wannabe_bool/string_spec.rb |
wannabe_bool-0.4.0 | spec/wannabe_bool/string_spec.rb |