Sha256: f84faa33278d0507cbb4b0e6d20699c35e0ecf985e59650f0c2e822b0974d020
Contents?: true
Size: 532 Bytes
Versions: 10
Compression:
Stored size: 532 Bytes
Contents
require 'spec_helper' describe Coercer::Object, '.to_integer' do subject { object.to_integer(value) } let(:object) { described_class.new } let(:value) { stub('value') } context 'when the value responds to #to_int' do let(:coerced) { stub('coerced') } before do value.should_receive(:to_int).with().and_return(coerced) end it { should be(coerced) } end context 'when the value does not respond to #to_int' do specify { expect { subject }.to raise_error(UnsupportedCoercion) } end end
Version data entries
10 entries across 8 versions & 4 rubygems