Sha256: 2e1738cf006f5ddef0eefe9e3d3ee5e0c9ea810784742d520c0ad9a141290f02
Contents?: true
Size: 501 Bytes
Versions: 14
Compression:
Stored size: 501 Bytes
Contents
require 'spec_helper' describe Coercer::Integer, '.to_boolean' do subject { object.to_boolean(fixnum) } let(:object) { described_class.new } context 'when the fixnum is 1' do let(:fixnum) { 1 } it { should be(true) } end context 'when the fixnum is 0' do let(:fixnum) { 0 } it { should be(false) } end context 'when the fixnum is not 1 or 0' do let(:fixnum) { -1 } specify do expect { subject }.to raise_error(UnsupportedCoercion) end end end
Version data entries
14 entries across 12 versions & 4 rubygems